TransWikia.com

Exiftool GPS tagging from lat/long works partially but it's always missing a timezone (which I think is the reason it gets actual pos wrong)

Photography Asked by delp on July 13, 2021

I have a GPS file containing data such as

<trkpt lat="56.9359839838" lon="-4.4651045874">
    <ele>30.42</ele>
    <time>2021-03-30T20:09:56Z</time>
</trkpt> 

I can then use exiftool on the cmd line (windows based machine) to do the following
exiftool -xmp:gpslongitude=-4.4651045874 -xmp:gpslatitude=56.9359839838 -GPSAltitude=30.42 DSC00320_b.JPG

Note that this does not work –
exiftool -exif:gpslongitude=-4.4651045874 -exif:gpslatitude=56.9359839838 -GPSAltitude=30.42 DSC00320_a.JPG
This drops the negative from the longitude and puts the GPS tag in the wrong position (as if the value was +ve)

After doing the xmp based command and I load the file into say Flickr it will put it’s location in the exact same spot as if the longitude value was positive!
So after checking another tool (GeoSetter) which has a map preview, it loads the same image and put it in the correct position?

So Flickr gets it wrong, but GeoSetter gets it right from the exact same image.

After digging around I find this is the reason.

enter image description here

If I use GeoSetter to set the time zone then upload to Flickr it now puts it in the correct position.

So simply put how do I set the time zone for GPS data? I’ve tried the following commands and a range of others which all fail.

"-gpstimestamp<${createdate}-00:00"
"-GPSTimeStamp<${DateTimeOriginal}" -n
-Geotime<DateTimeOriginal# -n
"-gpsdatestamp<${DateTimeOriginal}"

Finally if I do a visual comparison of data from the same file with valid timezone data (right) and one without (left) the addition of "Date/Time Digitized" stands out as being added, so I’m guessing this is why that file works. (there are also a considerable amount of other changes to the metadata after doing the timezone add via GeoSetter, I don’t think relevant to this Q, but if requested I can add more details)
enter image description here


Update of info for anyone interested since great answer below.
This image shows the difference in the metadata between the working file (left) and the file that doesn’t work everywhere (note Flickr gets it wrong) on the right.
You can see both files contain the correct data, but the working file contains all the correct data inside the same group, while the other has it spread into different groups.
image showing diff in metadata

One Answer

I can't explain what is happening exactly with Flickr but I can help fix some of the details with the problem.

You cannot set a timezone for the GPS time stamps (GPS:GPSDateStamp and GPS:GPSTimeStamp) because the GPS time stamps are required to be in UTC. It will always be +00:00.

The reason why your example GPS command fails is because the GPS coordinates are split into six separate tags, one each to hold the absolute value for each coordinate (GPSLatitude/GPSLongitude/GPSAltitude) and one each to hold the reference direction (GPSLatitudeRef/GPSLongitudeRef/GPSAltitudeRef with N/S/E/W/Above/Below). You need to set both to get the accurate gps coordinate. Luckily, with exiftool you can use a wildcard to set both at the same time
exiftool -GPSLatitude*=56.9359839838 -GPSLongitude*=-4.4651045874 -GPSAltitude*=30.42 DSC00320_a.JPG

Note that this only applies to the GPS coordinates that appear in the EXIF block (which exiftool groups under the GPS group). The GPS tags in the XMP-exif group do include the reference direction in the same tag, but not all programs can read these tags.

There may be additional details missing from your exiftool output because you are not showing group names and the possibly duplicate tag names. You should always use the command in ExifTool FAQ #3 to get all possible information from the file in order to make accurate before/after comparisons

Correct answer by StarGeek on July 13, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP