ExifTool Forum

ExifTool => Bug Reports / Feature Requests => Topic started by: StarGeek on November 03, 2024, 02:57:56 PM

Title: Setting GPS:GDop from GPS track
Post by: StarGeek on November 03, 2024, 02:57:56 PM
I ended up going down a rabbit hole of technical GPS stuff based upon a question elsewhere. Based upon that, this thread (https://exiftool.org/forum/index.php?msg=88914) and this ChatGPT session (https://chatgpt.com/share/6727d1e6-7c70-800a-ad07-7b2c1dc3eb60), it seems to me that when geotagging

The GPS:GPSDop should be set from "pdop" and GPS:GPSMeasureMode should be set to "3-Dimensional Measurement" if "pdop" exists
else
The GPS:GPSDop should be set from "hdop" and GPS:GPSMeasureMode should be set to "2-Dimensional Measurement" if "hdop" exists

Edit: Here's the discussion (https://github.com/nemethviktor/GeoTagNinja/issues/121) on GeoTagNinja's github page that started this for me.an
Title: Re: Setting GPS:GDop from GPS track
Post by: Phil Harvey on November 04, 2024, 05:14:35 PM
Thanks for this note.  Any idea what to do if pdop isn't available but hdop and vdop are?

- Phil
Title: Re: Setting GPS:GDop from GPS track
Post by: StarGeek on November 04, 2024, 06:50:12 PM
Quote from: Phil Harvey on November 04, 2024, 05:14:35 PMAny idea what to do if pdop isn't available but hdop and vdop are?

Like I said, write hdop if pdop isn't available.

The EXIF spec says of GPSDop
QuoteIndicates the GPS DOP (data degree of precision). An HDOP value is written during two-dimensional measurement, and PDOP during three-dimensional measurement.

I take that to mean that if pdop (three-dimensional measurement) isn't available, you would default to hdop (two-dimensional measurement).

Though it seems to me that if both hdop (horizontal degree of precision) and vdop (verticle degree of precision) exist, there should be a pdop. This PDF (http://gauss.gge.unb.ca/papers.pdf/gpsworld.may99.pdf) is referenced by the wikpedia page on Dilution of precision (https://en.wikipedia.org/wiki/Dilution_of_precision_(navigation)) and on page three of that PDF it says this (Pythagorean theorem?)
QuoteNote that PDOP2 = HDOP2 + VDOP2,

The whole thing is a bit over my head, but I guess the sequence could be
if PDOP {
    set GPS:GPSDop  = PDOP
    set GPS:GPSMeasureMode = 3-Dimensional Measurement
}
else if HDOP & VDOP {
    set GPS:GPSDop  = sqrt(HDOP^2+VDOP^2)
    set GPS:GPSMeasureMode = 3-Dimensional Measurement
}
else if HDOP {
    set GPS:GPSDop  = HDOP
    set GPS:GPSMeasureMode = 2-Dimensional Measurement 
}


As it is, there hasn't been anyone asking for this other than Mobilis (by way of the GeoTagNinja page), so it's hard to tell what the correct solution is.

If you like, I can ask some questions about the best procedure on some of the sub-reddits such as /r/GIS (Geographic Information Systems) or /r/Surveying.
Title: Re: Setting GPS:GDop from GPS track
Post by: Phil Harvey on November 04, 2024, 08:08:49 PM
OK, thanks.  I just thought there might be some formula to calculate pdop from hdop and vdop.  But it isn't that important to worry about it.

- Phil
Title: Re: Setting GPS:GDop from GPS track
Post by: Viktor Nemeth on November 25, 2024, 03:18:01 AM
Hi Phil,
Just checking in if this is on the roadmap at all? :)
Thanks

v.
Title: Re: Setting GPS:GDop from GPS track
Post by: Phil Harvey on November 25, 2024, 07:48:34 AM
This would require some research.  Viktor, maybe you can answer this:  When interpolating a position between two GPS fixes in a track, would it be valid to also interpolate the DOP values?  I'm guessing that a linear interpolation would be inaccurate.  How should this be handled?

- Phil
Title: Re: Setting GPS:GDop from GPS track
Post by: Viktor Nemeth on November 26, 2024, 06:28:04 AM
Hi Phil,

Not sure I'm just kindof relaying @Mobilis 's request but I'll nudge him to reply, he may know the answer.
Title: Re: Setting GPS:GDop from GPS track
Post by: Phil Harvey on November 26, 2024, 08:31:52 AM
I think I'll go ahead and do the interpolation anyway.  ExifTool 13.04 will have the ability to write GPSDOP and GPSMeasureMode from the -geotag feature.

- Phil
Title: Re: Setting GPS:GDop from GPS track
Post by: Viktor Nemeth on November 26, 2024, 10:54:16 AM
Awesome, thank you
Title: Re: Setting GPS:GDop from GPS track
Post by: Phil Harvey on November 26, 2024, 11:45:54 AM
I've just released 13.04 with this feature.

Thanks StarGeek for your help with this.  Your formula and algorithm seem reasonable, so I've implemented them.

- Phil
Title: Re: Setting GPS:GDop from GPS track
Post by: StarGeek on November 26, 2024, 12:54:32 PM
When I get a chance, I'll try and dig into this some more. There's a couple sub-Reddits that deal with the technical details of this, like the Surveyor's subreddit, and I'll ask around there.

Since there hasn't been any other requests for this in all these years, it's probably good enough. And if someone comes back with better details on how to process it, it can be changed then.
Title: Re: Setting GPS:GDop from GPS track
Post by: Viktor Nemeth on November 27, 2024, 12:23:46 PM
Quote from: StarGeek on November 26, 2024, 12:54:32 PMWhen I get a chance, I'll try and dig into this some more. There's a couple sub-Reddits that deal with the technical details of this, like the Surveyor's subreddit, and I'll ask around there.

Since there hasn't been any other requests for this in all these years, it's probably good enough. And if someone comes back with better details on how to process it, it can be changed then.

I've implemented it in a version of GTN (ref to that ticket on my github) - I think the user was specifically after HDOP  and GPSHPositioningError but since he's gone quiet I think when he has time he can feed back with thoughts. In the meantime, thank you both ;)
Title: Re: Setting GPS:GDop from GPS track
Post by: Phil Harvey on November 27, 2024, 12:48:30 PM
GPSHPositioningError and HDOP are completely different.  The former measures error in meters while the latter is a dimensionless ratio of the change in position with respect to a change in the input satellite measurement.

- Phil
Title: Re: Setting GPS:GDop from GPS track
Post by: Mobilis on December 01, 2024, 07:40:55 AM
Mobilis here. Sorry, I'm a bit late for the party, was away for a few days ;)

I'm no specialist, but as I understand it:
To calculate Horizontal Position Error (HPE) from Horizontal Dilution of Precision (HDOP), you can use the following formula:
HPE=HDOP×Best Accuracy
HPE=HDOP×Best Accuracy
Where:

    HPE is the Horizontal Position Error in meters.
    HDOP is the Horizontal Dilution of Precision, a unitless value.
    Best Accuracy is the specified accuracy of the GPS receiver in meters (this value can vary based on the type of GPS technology used).

The value for Best Accuracy, is usually considered to be 5 meters for commonly used GPS chipsets in Smartphones.

Hope this helps.

And many thanks for tackling this issue !
Title: Re: Setting GPS:GDop from GPS track
Post by: StarGeek on December 01, 2024, 10:47:40 AM
I would say the horizontal positioning error (GPS:GPSHPositioningError) is best left out as there are too many unknown variables to account for.

Best accuracy may be commonly 5 meters, but there's no way to know for certain.

By the EXIF standard, GDOP isn't necessarily the hdop value. See my first post as to what the EXIF standard says about GPS:GPSDOP.

The EXIF standard defines the GPS:GPSHPositioningError as only accounting for the horizontal value
Quote4.6.7.1.32. GPSHPositioningError
This tag indicates horizontal positioning errors in meters.

But the EXIF definition of GPS:GPSDOP may include a vertical component by using pdop. Computing based upon pdop would just increase the error level of the GPS:GPSHPositioningError.

Finally, from what I understand, the EXIF GPSDOP value is already going to be off since it's only based on hdop/pdop. There is also a time based component that is supposed to be part of the gdop (the actual gdop value, not the GPS:GPSDOP value). From the PDF I linked above

QuoteNote that PDOP2 = HDOP2 + VDOP2, and GDOP2 = PDOP2 + TDOP2.

Where the T stands for Time
QuoteMany of us also know that DOP comes in various flavors, including geometrical (GDOP), positional (PDOP), horizontal (HDOP), vertical (VDOP), and time (TDOP).

Because you need to have the error filled out, I would suggest running this command afterward to fill the GPS:GPSHPositioningError, replacing the 5 with the actual accuracy value
exiftool "-GPSHPositioningError<${GPSDOP;$_*=5}" /path/to/files/

It's technically not accurate, but it would fill the tag for you.