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