What are acceptable GPSMapDatum options, or is it best to stick to one standard

Started by AnK, September 29, 2015, 10:49:47 AM

Previous topic - Next topic

AnK

I am making a script to geotag photos.
I could set the GPSLatitude and GPSLongitude directly using WGS84 decimal format (positive and negative numbers with seven decimals)
But than I see that most geotagged pictures I got have coordinates in DMS , like
GPSLatitude                     : 69 deg 27' 9.60" N
GPSLongitude                    : 20 deg 56' 2.20" E
GPSPosition                     : 69 deg 27' 9.60" N, 20 deg 56' 2.20" E

.. and no GPSMapDatum at all...

Does it mean that standard is considered "default" ?
If I would use WGS84 with , is it "ok" ? - and what should  GPSMapDatum contain ? - a string like WGS 84 , or EPSG:4326 or something else ?
 

Phil Harvey

I think that FAQ 14 may answer your question about the coordinate format.

Checking all of my sample images, a large majority of GPSMapDatum values are set to "WGS-84", which is the string mentioned in the EXIF specification.  Other values I have seen in order of popularity are "", "WGS84", "WGS 1984", "Unknown", "WGS 84" and "TOKYO", but of these only "TOKYO" is mentioned in the EXIF spec.

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

AnK

ok, so I will stick to DMS , and WGS-84.
Is there something that dictates that seconds (in DMS) can have only two decimals ?  I noticed that having three or four is only read back as two.

Phil Harvey

I don't think you understood.  You may read/write the coordinates in any format you want.  This is completely independent of the way they are stored in the file.

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

AnK

yes, I did understood that , but when your experience says that DMS WGS-84 is the most used - then I'd like to stick with that to ensure compatibility with as many(stiching) tools as possible.
When I try: exiftool -exif:gpslongitude="22d16'32.683" -exif:gpslongituderef=E -exif:gpslatitude="69d36'14.801"  -exif:gpslatituderef=N test.jpg

is read back as 69 deg 36' 14.80" N, 22 deg 16' 32.68" E
(one digit less) , but you cached tha "d" instead of " deg " just fine :)
- so it seems to be it's modified before stored ?  ..or ... is it stored as "22d16'32.683"  , and you only reformat it on reading ?


Phil Harvey

Any values written are modified to conform with the storage format specified by the EXIF specification, which is 3 rational values.  With ExifTool, the way to see what is actually written is with the -v option.  For example:

  | + [GPS directory with 5 entries]
  | | 0)  GPSVersionID = 2 3 0 0
  | | 1)  GPSLatitudeRef = N
  | | 2)  GPSLatitude = 69 36 14.801 (69/1 36/1 14801/1000)
  | | 3)  GPSLongitudeRef = E
  | | 4)  GPSLongitude = 22 16 32.683 (22/1 16/1 32683/1000)


The rational values actually stored in the file are shown in brackets.

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

AnK