Main Menu

GPS Precision

Started by victorengel, July 30, 2024, 03:04:49 PM

Previous topic - Next topic

victorengel

I was having a discussion with someone about GPS precision. He was remarking that when he checks the properties of an image to see what the GPS precision is, it has absurdly many decimal digits (I think he said 14 digits). I was trying to explain to him that EXIF does not store GPS data as decimal values. That is simply an artifact of the conversion from the stored EXIF data in rational unsigned integers to a decimal expansion, and that the extra digits come from whatever tool he is using to display the value, rather than in the EXIF data.

To illustrate, I pulled up a random image taken by my iPhone and found out that the exiftool -v option displays the rational details. That's when I found something surprising. For this file, Apple's finder displays the latitude for that picture as 30° 21' 26.838" N. Curious to see what the integers actually were to represent that value, I fired up exiftool. It reported GPSLatitude = 30 21 26.84 (30/1 21/1 2684/100). Since the denominator is a power of 10 it can be represented exactly as a decimal value, and seconds are 26.84 rather than 26.838. It seems that Apple's Finder utility must be converting from degrees, minutes, and seconds from EXIF to something else and then back to degrees, minutes, and seconds, with resulting rounding errors.

Core location (I'm guessing they probably use something in that framework for it) stores latitude and longitude as doubles. Playing with the values, I get 26.838 if I first convert the EXIF values to decimal truncating to 6 decimal digits and then converting back to degrees, minutes, and seconds. Since internally 64 bit numbers are used in calculations, I wonder why they are truncating. Probably just bad programming.

StarGeek

You should also double-check to see if there are XMP GPS tags. I believe those are stored as Degrees and Minutes only, with Minutes having a decimal value. This may or may not have an effect on the saved values.

For example, with the -v3 (-verbose3) option
  | + [GPS directory with 5 entries]
  | | 0)  GPSVersionID = 2 3 0 0
  | |     - Tag 0x0000 (4 bytes, int8u[4]):
  | |         0070: 02 03 00 00                                     [....]
  | | 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]):
  | |         00a8: 00 00 00 28 00 00 00 01 00 00 00 29 00 00 00 01 [...(.......)....]
  | |         00b8: 00 00 02 10 00 00 00 19                         [........]
  | | 3)  GPSLongitudeRef = W
  | |     - Tag 0x0003 (2 bytes, string[2]):
  | |         0094: 57 00                                           [W.]
...
  + [XMP directory, 2854 bytes]
  | XMPToolkit = Image::ExifTool 12.89
  | GPSLatitude = 40,41.352N
  | - Tag 'x:xmpmeta/rdf:RDF/rdf:Description/exif:GPSLatitude'
  | GPSLongitude = 74,2.67W
  | - Tag 'x:xmpmeta/rdf:RDF/rdf:Description/exif:GPSLongitude'

"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Phil Harvey

Quote from: victorengel on July 30, 2024, 03:04:49 PMIt seems that Apple's Finder utility must be converting from degrees, minutes, and seconds from EXIF to something else and then back to degrees, minutes, and seconds,

This is what ExifTool does too.  See here for details about the conversions done.

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