ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: asia888 on May 22, 2024, 06:12:15 AM

Title: The decimal places in the GPS Altitude are too few
Post by: asia888 on May 22, 2024, 06:12:15 AM
The decimal places in the GPS Altitude are too few.
Title: Re: The decimal places in the GPS Altitude are too few
Post by: StarGeek on May 22, 2024, 10:07:43 AM
In what way is it "too few".  Can you provide a sample image and explain why it is wrong?

The data in the GPS tags is saved as a fraction. There may be minor rounding differences when displaying the data as a decimal. You can use the -n (--printConv) option (https://exiftool.org/exiftool_pod.html#n---printConv) to list the entire decimal number that is converted from that fraction or the -c (-coordFormat) option (https://exiftool.org/exiftool_pod.html#c-FMT--coordFormat) to control how the data is printed.
Title: Re: The decimal places in the GPS Altitude are too few
Post by: Phil Harvey on May 24, 2024, 03:19:15 PM
Use the -n option and you'll see all available digits of precision.

- Phil
Title: Re: The decimal places in the GPS Altitude are too few
Post by: wywh on May 25, 2024, 06:35:22 AM
Add -v to see the fractions.

In images the max displayed decimals seem to be 8 for altitude (91/81 ≈ 1.12345679 in the example below) or less if the integer has more digits (max integer length seems to be 10 digits, and overflowing decimals are truncated):

exiftool -m -P -overwrite_original '-GPSLatitude*=29.9792' '-GPSLongitude*=31.1342' '-GPSAltitude*=1.1234567890123456789' image.jpg

exiftool -a -G1 -s -Location:All -n -v image.jpg
  | 5)  GPSInfo (SubDirectory) -->
  | + [GPS directory with 7 entries]
  | | 0)  GPSVersionID = 2 3 0 0
  | | 1)  GPSLatitudeRef = N
  | | 2)  GPSLatitude = 29 58 45.12 (29/1 58/1 1128/25)
  | | 3)  GPSLongitudeRef = E
  | | 4)  GPSLongitude = 31 8 3.12 (31/1 8/1 78/25)
  | | 5)  GPSAltitudeRef = 0
  | | 6)  GPSAltitude = 1.12345679 (91/81)
[GPS]           GPSLatitude                     : 29.9792
[GPS]           GPSLongitude                    : 31.1342
[GPS]           GPSAltitude                     : 1.12345679

Likewise, for movies it seems to be max 14 decimals for altitude. The max string length seems to be 15 digits; overflowing decimals are truncated:

exiftool -m -P -overwrite_original -Keys:GPSCoordinates='29.9792, 31.1342, 12345678901234.1234567890123456789' movie.mp4

exiftool -a -G1 -s -Location:All -n -v movie.mp4
  | | Keys (SubDirectory) -->
  | | + [Keys directory]
  | | | Added ItemList Tag 1.1 = (mdta) location.ISO6709
  | | ItemList (SubDirectory) -->
  | | + [ItemList directory]
  | | | GPSCoordinates = +29.9792+031.1342+12345678901234.100/
[Keys]          GPSCoordinates                  : 29.9792 31.1342 12345678901234.1

- Matti