How to get long ref and lat ref tags for GPS EXIF data

Viewed 259

I have small script in Python that use files from GPS Logger Android application.

The data in csv format look like this:

type,date time,latitude,longitude,accuracy(m),altitude(m),geoid_height(m),speed(m/s),bearing(deg),sat_used,sat_inview,name,desc
W,2020-10-15 16:33:16,48.97725712,16.96244793,15,258.483,43.517,0.000,,8,25,,Day1

(There are also GPX file but I think, that it don't have altitude data)

and I've just notice that GPS also have long ref and lat ref tags. I've found them in Pic2Map service that show GPS data for my photo. Maybe that is because Wikimedia commons don't detect GPS properly when uploading images and I need to type GPS data by hand.

is it possible to extract this information from this csv table? If yes then how I should do that? Or maybe the data that is shown in this file only work with part of the Globe, I'm not able to test this app because I never traveled outside of Europe (and right now because of Covid you can't travel anyway).

I'm also not sure if you can add those tags using exiftool that I use in my script to actually update the Exif data.

1 Answers

The GPS reference tags are important when the location is in the western and/or southern hemisphere or if the altitude is below sea level. Assuming that your CVS file would properly show a negative number in those cases, all you have to do with exiftool would be to set the ref tags with the same value. Exiftool will automatically figure out the correct reference direction from the coordinates.

Using part of your example script, you should be able to do this to properly set the references

'-GPSLatitude=%s' % loc['latitude'],  
'-GPSLongitude=%s' % loc['longitude'],
'-GPSAltitude=%s' % loc['altitude(m)'],
'-GPSLatitudeRef=%s' % loc['latitude'],
'-GPSLongitudeRef=%s' % loc['longitude'],
'-GPSAltitude=Ref%s' % loc['altitude(m)'],

Exiftool also allows for the use of an asterisk wildcard when setting tags, so you might be able to do this to set the value and reference at the same time.

'-GPSLatitude*=%s' % loc['latitude'],
'-GPSLongitude*=%s' % loc['longitude'],
'-GPSAltitude*=%s' % loc['altitude(m)'],
Related