Setting GPS:GDop from GPS track

Started by StarGeek, November 03, 2024, 02:57:56 PM

Previous topic - Next topic

StarGeek

I ended up going down a rabbit hole of technical GPS stuff based upon a question elsewhere. Based upon that, this thread and this ChatGPT session, 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 on GeoTagNinja's github page that started this for me.an
"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

Thanks for this note.  Any idea what to do if pdop isn't available but hdop and vdop are?

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

StarGeek

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 is referenced by the wikpedia page on Dilution of precision 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.
"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

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

Viktor Nemeth

Hi Phil,
Just checking in if this is on the roadmap at all? :)
Thanks

v.

Phil Harvey

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

Viktor Nemeth

Hi Phil,

Not sure I'm just kindof relaying @Mobilis 's request but I'll nudge him to reply, he may know the answer.

Phil Harvey

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

Viktor Nemeth


Phil Harvey

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

StarGeek

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.
"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

Viktor Nemeth

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 ;)

Phil Harvey

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

Mobilis

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 !

StarGeek

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.
"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