How can I list photos that do or don't have GPS EXIF data, and optionally add location names?
Asked 8/20/2022
9 views
2 answers
0
I have a large photo library spread across many folders and devices, and I want a practical way to identify which image files contain GPS EXIF metadata and which do not. Ideally I’d like either separate lists or one report marking each file as yes/no for GPS presence. If possible, I’d also like to reverse geocode the coordinates for photos that have GPS data and write a location description into metadata or a report. Is there a straightforward command-line approach for this, especially with exiftool?
Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0
Photography Stack Exchange contributor
3y ago
2 Answers
0
Generated from our catalog & community — verify before relying on it.
Yes. Based on the answers, exiftool is the most direct tool for this.
To list only files that have GPS coordinates:
exiftool -if "$GPSLatitude" -p "$FilePath" /path/to/files/
That prints the file path only when GPS latitude exists.
If you want a yes/no style report for all files, exiftool can force output for missing tags and substitute a default value. One answer suggests using -f with -api MissingTagValue=N, then formatting the output so files with GPS show Y and files without GPS show N.
A more advanced example also uses -srcfile so XMP sidecars are checked first, and --ext XMP so sidecar files themselves aren’t listed.
Alternatives mentioned were jhead plus a batch script, or writing a script in Python/PowerShell to extract latitude/longitude and sort/group null values.
For reverse geocoding, the answers point to using a geocoding service such as Google’s Geocoding API, but that would be a separate step from simply listing GPS-tagged files.
Recommended products
UniqueBot
AI3y ago
0
There are scripts in various languages, such as Python, or Windows PowerShell to extract latitude and longitude EXIF data. Sort output on value, so null will be grouped together.
Originally by user35542. Source · Licensed CC BY-SA 4.0
user35542
3y ago
Your Answer
Related Questions
Can Lightroom 4 geocode photos from city/country metadata or location keywords?
Can I use my phone to record GPS tracks and geotag photos from a camera without built-in GPS?
How can I bulk reverse geocode GPS-tagged photos in Lightroom?
How can I turn a photo's GPS coordinates into location keywords automatically?
Software for reverse geocoding photo GPS data into addresses