longitude/latitude are swapped when geotagging with certain KML files

Started by lpm, May 31, 2010, 11:34:48 PM

Previous topic - Next topic

lpm

This is a head scratcher...
OS - Windows XP 32-bit SP3
exiftool - 8.05 and 8.20
exact command: exiftool -geotag test.kml test.jpg

After geotagging, the output of 'exiftool test.jpg' shows Latitude and Longitude reversed, the geo tag is erroneous.
GPS Latitude                    : 122 deg 41' 26.26" S
GPS Longitude                   : 45 deg 30' 29.90" E
GPS Position                    : 122 deg 41' 26.26" S, 45 deg 30' 29.90" E

If I use the GPX format instead, the problem does not happen. I initiatlly assumed I had a corrupted KML file, but I can't see what's wrong with it, it looks fine visually and opens OK in Google Earth.


Phil Harvey

Wow, you're quite right.  Thanks for the report.

I just checked the KML specification and the order of the coordinates is long then lat, but exiftool was reading them the other way around.  Ooops!

This will be fixed in exiftool 8.21.

- 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 ($).

lpm

Phil,

Thank you very much for the quick reply - ping me if you need to use me for testing. exiftool rocks.

Laurent

Phil Harvey

Hi Laurent,

Thanks for the offer.  I think I have all that I need with the samples you sent.  I had to guess at your timezone though, either UTC-07 or UTC-08 I assume.

- 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 ($).