geotag GPSAltitude CR2 RAW file

Started by Uwe, September 07, 2023, 05:22:35 PM

Previous topic - Next topic

Uwe

Hello,
ExifTool 12.6.5.0
I write GPS metadata into the CR2 RAW file using the following command in ExifToolGUI (the CR2 file is selected): -geotag=GPX_file.gpx
This is the result:
XMP-exif:GPSAltitude=2162.97823458283 m
Exif:GPSAltitude=2162.978235 m
I have not found this altitude in any place in the GPX file(attached). The GPX file was created by Garmin Oregon 600.
When I read the CR2 file into the DAM database of Daminion (www.daminion.net), the value of the Altitude is: 2162.9782345828294. This means that the value in XMP-exif:GPSAltitude is also rounded.
In general, the accuracy of the altitude less than 1m is not necessary in these cases from my point of view.
My questions: why are metadata written with different precision and is it possible to set the number of decimal places/rounding when writing the GPS Altitude metadata ?
Thank you and best regards, Uwe20160928_164744.gpx

StarGeek

Quote from: Uwe on September 07, 2023, 05:22:35 PMThis is the result:
XMP-exif:GPSAltitude=2162.97823458283 m
Exif:GPSAltitude=2162.978235 m
I have not found this altitude in any place in the GPX file(attached). The GPX file was created by Garmin Oregon 600.

Exiftool doesn't use the closest track point to the time given in the image.  From the Geotagging with ExifTool page
QuoteThe GPS track log file is loaded, and linear interpolation is used to determine the GPS position at the time of the image

So unless the image was taken exactly at the same time as one of the time stamps in the track, it's going to be an approximate altitude based upon the track point before and after that time stamp.

QuoteMy questions: why are metadata written with different precision

GPS coordinates, latitude and longitude as well as altitude, are not saved as decimal numbers in image files as they are in the GPX file.  In the case of GPSLatitude/GPSLongitude, they are saved as three fractions (degrees, minutes, seconds) while GPSAltitude is saved as a single fraction. And because of this, some rounding will occur.

So when you look at the actual values that are stored in the file using the -v3 (-verbose3) option, you can see the following data, using GPS coordinates of 40.6892, -74.0445, 2162.9782345828294
| | 1)  GPSLatitudeRef = N
  | |    - Tag 0x0001 (2 bytes, string[2]):
  | |        007c: 4e 00                                          [N.]
  | | 2)  GPSLatitude = 40 41 21.12 (40/1 41/1 528/25)
  | |    - Tag 0x0002 (24 bytes, rational64u[3]):
  | |        00c0: 00 00 00 28 00 00 00 01 00 00 00 29 00 00 00 01 [...(.......)....]
  | |        00d0: 00 00 02 10 00 00 00 19                        [........]
  | | 3)  GPSLongitudeRef = W
  | |    - Tag 0x0003 (2 bytes, string[2]):
  | |        0094: 57 00                                          [W.]
  | | 4)  GPSLongitude = 74 2 40.2 (74/1 2/1 201/5)
  | |    - Tag 0x0004 (24 bytes, rational64u[3]):
  | |        00d8: 00 00 00 4a 00 00 00 01 00 00 00 02 00 00 00 01 [...J............]
  | |        00e8: 00 00 00 c9 00 00 00 05                        [........]
  | | 5)  GPSAltitudeRef = 0
  | |    - Tag 0x0005 (1 bytes, int8u[1]):
  | |        00ac: 00                                              [.]
  | | 6)  GPSAltitude = 2162.978235 (1788783/827)
  | |    - Tag 0x0006 (8 bytes, rational64u[1]):
  | |        00f0: 00 1b 4b 6f 00 00 03 3b                        [..Ko...;]

As you can see, the GPSLatitude is saved as "40/1 41/1 528/25", the GPSLongitude is "74/1 2/1 201/5", and the GPSAltitudeis "1788783/827"

Quoteis it possible to set the number of decimal places/rounding when writing the GPS Altitude metadata ?

Using the -GeoTag option, I'm not sure.  You can try using the -c (-coordFormat) option to see if that works. Editing one of the examples given there, you could try -c "%.6f" to see if you get 6 degrees of precision.  But of course, that still might end up with longer numbers depending upon what the actual fractions end up as.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Uwe

Hello StarGeek,
thanks for the quick reply and the detailed explanation. I have understood it. So the irritation I had stems from the fact that different programs/GUI only display the altitude stored internally as a fraction, depending on the tag, XMP-exif:GPSAltitude or Exif:GPSAltitude with different accuracy. The accuracy/format with which Daminion treats the issue is therefore a different playground.
Thank you, Uwe