How does exiftool handle GPS DMS rather than decimal?

Started by eco, January 07, 2019, 05:56:56 AM

Previous topic - Next topic

eco

Hi everyone,

I am using Python to to pull GPS data out of a Lightroom database and insert it directly into the file using Exiftool of course! ;)

The data is presented in the database as follows:


exif:GPSLatitude="45,33.7893333333N"
exif:GPSLongitude="73,34.7643333333W"

I tried the following with and without '-n' and I get the same coordinates:

$ exiftool -ignoreMinorErrors -overwrite_original -preserve -gpslatitude=45.563155555555 -gpslongitude=-73.579405555555 myfile.jpg

The actual Python list looks like this:

('-ignoreMinorErrors', '-overwrite_original', '-preserve', '-gpslatitude=45.563155555555', '-gpslongitude=-73.579405555555', 'myfile.jpg')

Instead of being in Canada, I end up in ‎⁨Jambyl⁩, ⁨Kazakhstan⁩

I suspect it has to do with N,S/E,W but I am not sure how to handle this with Exiftool. West and South seem to be translated as Negative numbers when in decimal degrees. Can Exiftool handle this or should I start using regex to find cardinal direction?

Any help is appreciated.

Thank you all!

@Phil, thank you for helping me manage my photo library!

eco

After a bit more digging I am seeing the following:

$ exiftool -ignoreMinorErrors -overwrite_original -preserve -gpslatitude='29.952294444445' -gpslongitude='-90.083705555555' myfile.jpg

$ exiftool /myfile.jpg -gps:all -a -g1
---- GPS ----
GPS Version ID                  : 2.3.0.0
GPS Latitude                    : 29 deg 57' 8.26"
GPS Longitude                   : 90 deg 5' 1.34"


I see no Cardinal information so it looks like the minus sign of the longitude is not taken into account. I suspect I am making a mistake here but I can't see what it is. I've been at it for too long! ;)

Phil Harvey

I think that reading FAQ 14 should answer your questions.

... after all, we want you to stay in Canada. ;)

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

eco

Hi Phil,

Thank you for your help. My trip to Canada was a great one.

I hesitated putting the question in the Newbies section. I shouldn't have. ;)

Thanks again!