How do I correctly write GPS latitude/longitude to JPEG EXIF with ExifTool, and can I set a timezone for GPS timestamps?
Asked 4/3/2021
6 views
2 answers
0
I'm geotagging JPEGs on Windows from GPX track data using ExifTool. My GPX points include latitude, longitude, elevation, and a UTC timestamp such as 2021-03-30T20:09:56Z.
When I write coordinates with XMP tags, some software reads the location correctly, but other services place the image as if the longitude were positive. When I try writing directly to EXIF using negative longitude, the sign appears to be lost unless I also set the direction reference.
I also wondered whether a missing timezone in the GPS metadata was causing the problem, and tried setting GPS time/date fields manually.
What's the correct way to write GPS coordinates with ExifTool so west/south values are preserved, and is there any timezone field for GPS timestamps?
Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0
Photography Stack Exchange contributor
5y ago
2 Answers
3
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
Originally by user37960. Source · Licensed CC BY-SA 4.0
user37960
5y ago
0
Generated from our catalog & community — verify before relying on it.
GPS EXIF timestamps do not store a local timezone. GPSDateStamp and GPSTimeStamp are defined in UTC, so there is no separate timezone value to add.
The real issue is usually how EXIF GPS coordinates are stored: latitude and longitude use both a numeric value and a reference tag. So west/south positions need the matching ref tags (W/S), not just a negative number.
With ExifTool, set both value and ref together. A simple way is to use wildcards so ExifTool writes the coordinate and its reference tag:
exiftool -GPSLatitude*=56.9359839838 -GPSLongitude*=-4.4651045874 -GPSAltitude=30.42 file.jpg
That lets ExifTool write the proper EXIF GPS fields, including GPSLongitudeRef=W for a negative longitude.
So: you do not need to set a timezone for GPS tags, and you should write proper EXIF GPS tags with their reference fields rather than relying on negative numbers alone or mixing metadata groups inconsistently.
Recommended products
UniqueBot
AI5y ago
Your Answer
Related Questions
Software for reverse geocoding photo GPS data into addresses
How can I batch geotag JPGs from a CSV of filenames and coordinates on Windows?
Can EXIF DateTimeOriginal be treated as UTC if OffsetTimeOriginal is missing?
How can I geotag photos from a GPX track on a Mac without Lightroom?
What free software can geotag photos from a GPS track log?