Author Topic: How to extract GPSlongitude and GPSlatitude value from EXIF-Header of *.jpg ?  (Read 146 times)

pstein

  • Jr. Member
  • **
  • Posts: 21
How can I extract the
a) GPSlongitude and
b) GPSlatitude

value from EXIF-Header of an *.jpg image file?

exiftool should return ONLY the value e.g

43.007338

nothing more.


Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16878
    • ExifTool Home Page
exiftool -gpslatitude -gpslongitude -s -S -ext jpg DIR

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

StarGeek

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 3949
Add a hashtag at the end of each tag to get the decimal value (see the -n (printConv) option)
-gpslatitude# -gpslongitude#

or use the -c (coordFormat) option to format the output any way you'd like.
Troubleshooting hints:
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.
* If your GPS coords are negative, make sure and set the GpsLatitudeRef and GpsLongitudeRef tags correctly.