Need help writy GPSHPositioningError to jpg files using gpx Hdop

Started by Mobilis, March 11, 2025, 04:33:39 AM

Previous topic - Next topic

Mobilis

Hello everyone !
I'm back to tackling a problem I have tried to solve before, and I think I'm getting there but...

So, the objective is to fill the GPSHPositioningError in jpg files before uploading them to iNaturalist

My GPX contains a value for hdop:
Quote<trkpt lat="50.67569585275792" lon="3.1550779827760373"><ele>85.82046451939033</ele><time>2025-03-05T02:42:08.000Z</time><extensions><gpxtpx:TrackPointExtension><gpxtpx:bearing>314.95602</gpxtpx:bearing><gpxtpx:speed>0.9405375</gpxtpx:speed></gpxtpx:TrackPointExtension></extensions><geoidheight>47.2</geoidheight><src>gps</src><sat>39</sat><hdop>0.9</hdop><vdop>1.1</vdop><pdop>1.4</pdop></trkpt>

The GPX file is in the same folder as the pictures and exiftool (ver 13.10) sees the tag:
C:\#Base\ExifTools\exiftool *.gpx
returns this
Gpx Trk Trkseg Trkpt Hdop       : 0.8

so I tried the command:
C:\#Base\ExifTools\exiftool -geotag "D:\5-PhotoWorks\3-Last Filter\*.gpx" -overwrite_original "-GPSHPositioningError<$Gpx:Trk:Trkseg:Trkpt:Hdop*4" *.jpg

But I get this error:
Warning: [minor] Tag 'Gpx:Trk:Trkseg:Trkpt:Hdop' not defined - _TAR0569.jpg
And of course the files do not get the wanted accuracy change ...

And there I am, lost...  :) Any help most welcome !

StarGeek

Quote from: Mobilis on March 11, 2025, 04:33:39 AMThe GPX file is in the same folder as the pictures and exiftool (ver 13.10) sees the tag:
C:\#Base\ExifTools\exiftool *.gpx
returns this
Gpx Trk Trkseg Trkpt Hdop      : 0.8

Note that this is a tag description, not a tag name (see FAQ #2, "How do I determine the tag name for some information"). Add the -s (-short) option to find out what the actual tag name is.

But this wouldn't be a -geotag operation. From what I recall of the previous thread, the hdop value was interpolated and copied into GPSDOP (unless pdop or vdop was also available). So once the geotagging was done, you would use the command I posted here.
exiftool "-GPSHPositioningError<${GPSDOP;$_*=4}" /path/to/files/

Copying hdop from a gpx would use the -TagsFromFile option. Something like this, replacing "hdop tag" with the name you found after using the -s option
exiftool -TagsFromFile file.gpx "-GPSHPositioningError<${hdop tag;$_*=4}" file.jpg

But note that you have to name a specific gpx file. And this won't be an operation that would figure out the closest hdop value at a specific time. It would be a simple Last In, First Out, i.e. the last hdop value in the file would be the only one returned.
"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

Mobilis

Ok, thanks a lot for the explanation: much clearer now.
What I was hoping for was something in the line of the -TagsFromFile, but as it does not correlate with the picture time, it will not work any better that what I currently do (ie, using a arbitrary but realistic value for accuracy).
Too bad, I was really hoping this would work. Maybe some time in the future ?
For the moment I'm satisfied that there is no real solution.
Thanks again.

StarGeek

Why don't you feel the option I provided works?

If you specifically need hdop, you could edit your GPX file to remove the pdop/vdop entries, use that copy to geotag you files. That would force hdop to be copied to GPSDOP. Then run the command I provided. Then rerun the geotag on the original GPX file to get GPSDOP filled with the pdop/vdop values if needed.
"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

Mobilis

Maybe I did not understand what you proposed (most probable explanation  ;D )
But I think you said that it would not use the accuracy at the time of the picture, but the last value found in the gpx file.
In that case, this would not do because I use a 24/24 logger and the last accuracy value would be just before midnight, when I'm usually indoors  ;), and that value would not be related to the real accuracy at the time of the picture...
If this is indeed the case I might as well use an arbitrary value that I know to be close the the real one when I'm outdoors.
Feel free to tell me if and where I'm mistaken !

StarGeek

Quote from: Mobilis on March 11, 2025, 02:14:39 PMBut I think you said that it would not use the accuracy at the time of the picture, but the last value found in the gpx file.

From what I recall from the previous thread, accuracy was based upon the device and not part of the GPX file. In this thread, you seem to be using *4 as the accuracy, while *5 was the example in the previous thread. Multiply that times the hdop/gdop gets GPSHPositioningError.

Exiftool is setting the GPSDOP from the hdop (or pdop or sqrt(HDOP^2+VDOP^2), depending upon what's in the file) and that value is being interpolated from what is in the GPX track. So GPSDOP * 4 = GPSHPositioningError. Which is what my command is doing.
"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

Mobilis

Thank you so much for your explanations and your patience !
And now I feel really stupid: the only reason that what you suggested did not work for me was a mistake on my part: I did not keep the quotes around "-GPSHPositioningError<${GPSDOP;$_*=4}" !!!!!
And now it works perfectly ! Thanks a lot !