Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding tag value for accuracy #121

Open
tarbault opened this issue Nov 3, 2024 · 13 comments
Open

Adding tag value for accuracy #121

tarbault opened this issue Nov 3, 2024 · 13 comments
Assignees
Labels
enhancement New feature or request

Comments

@tarbault
Copy link

tarbault commented Nov 3, 2024

Is your feature request related to a problem? Please describe.
I use GeotagNinja to tag images of plants and animals to upload them on iNaturalist.
iNaturalist "requires" if possible the accuracy to be present to assess the quality of an observation.
Most research studies discard observations missing accuracy.

Describe the solution you'd like
use the value of the HDOP present in the GPX to fill the tag named GPSHPositioningError

sample tag is: <hdop>1.3</hdop>
Sample gpx file attache with a full line

Describe alternatives you've considered
I found no software that can do that as of today

Additional context
Add any other context or screenshots about the feature request here.
20241102.txt

@tarbault tarbault added the enhancement New feature or request label Nov 3, 2024
@nemethviktor
Copy link
Owner

Hi,

I'll need a bit more context please as admittedly I don't understand what you would like at this stage. Also I'm not entirely sure that if I do understand correctly what you're after, it's possible.

As for the request:
In the Import GPX (?? -- if not, shout pls.) you'd like to import the HDOP values (associated with a timestamp?) and then write those values as a new tag (?) called GPSHPositioningError

I've taken an arbitrary jpg file and aligned it with your txt file and did: exiftool -geotag 20241102.txt -v4 20241027_Virginia_Water_EOS_50D_IMG_3383_MOD_20241028.JPG
Where my output was then:

d:\temp>exiftool -geotag 20241102.txt -v4 20241027_Virginia_Water_EOS_50D_IMG_3383_MOD_20241028.JPG
Argument "-Geotime<DateTimeOriginal#" is assumed
Loaded 1 points from XML-format GPS track log file '20241102.txt'
  GPS track start: 2024:11:01 23:00:14.000 UTC
    2024:11:01 23:00:14.000 UTC - alt=74.24 first=1 hdop=2.9 lat=50.67 lon=3.15 nsats=13 pdop=4.3 speed=0.07628542 vdop=3.2
  GPS track end:   2024:11:01 23:00:14.000 UTC
Writing File:Geotag
======== 20241027_Virginia_Water_EOS_50D_IMG_3383_MOD_20241028.JPG
Setting new values from 20241027_Virginia_Water_EOS_50D_IMG_3383_MOD_20241028.JPG
  Geotime value:   2024:11:01 23:00:58.000 UTC (local timezone is +00:00)
  Taking pos from fix:
    2024:11:01 23:00:14.000 UTC - alt=74.24 first=1 hdop=2.9 lat=50.67 lon=3.15 nsats=13 pdop=4.3 speed=0.07628542 vdop=3.2
Writing Keys:GPSCoordinates if tag exists
Writing UserData:GPSCoordinates if tag exists
Writing UserData:GPSCoordinates if tag exists
Writing ItemList:GPSCoordinates
Writing MIE-GPS:GPSLatitude
Writing XMP-drone-dji:GPSLatitude if tag exists
Writing XMP-exif:GPSLatitude if tag exists
Writing GPS:GPSLatitude
Writing MIE-GPS:GPSLongitude
Writing XMP-drone-dji:GPSLongitude if tag exists
Writing XMP-exif:GPSLongitude if tag exists
Writing GPS:GPSLongitude
Writing MIE-GPS:GPSAltitude
Writing XMP-exif:GPSAltitude if tag exists
Writing GPS:GPSAltitude
Writing XMP-exif:GPSAltitudeRef if tag exists
Writing GPS:GPSAltitudeRef
Deleting MIE-GPS:GPSTrack
Deleting XMP-exif:GPSTrack
Deleting GPS:GPSTrack
Deleting XMP-exif:GPSTrackRef
Deleting GPS:GPSTrackRef
Writing MIE-GPS:GPSSpeed
Writing XMP-exif:GPSSpeed if tag exists
Writing GPS:GPSSpeed
Writing XMP-exif:GPSSpeedRef if tag exists
Writing GPS:GPSSpeedRef
Writing GPS:GPSLatitudeRef
Writing GPS:GPSLongitudeRef
Writing GPS:GPSDateStamp
Writing GPS:GPSTimeStamp
Writing XMP-exif:GPSDateTime if tag exists
Rewriting 20241027_Virginia_Water_EOS_50D_IMG_3383_MOD_20241028.JPG...
  Editing tags in: APP0 APP1 File GPS IFD0 ItemList JFIF Keys MIE-GPS UserData XMP
  Creating tags in: APP1 File GPS IFD0 ItemList MIE-GPS
JPEG APP1 (12736 bytes)
  Rewriting IFD0
  Rewriting ExifIFD
    [nothing changed in ExifIFD]
  Creating GPS
    + GPS:GPSVersionID = '2 3 0 0' (mandatory)
    + GPS:GPSLatitudeRef = 'N'
    + GPS:GPSLatitude = '50 40 12.0000000000063'
    + GPS:GPSLongitudeRef = 'E'
    + GPS:GPSLongitude = '3 8 59.9999999999997'
    + GPS:GPSAltitudeRef = '0'
    + GPS:GPSAltitude = '74.24'
    + GPS:GPSTimeStamp = '23 00 58'
    + GPS:GPSSpeedRef = 'N'
    + GPS:GPSSpeed = '0.07628542'
    + GPS:GPSDateStamp = '2024:11:01'
  Rewriting IFD1
JPEG APP13 (12090 bytes)
JPEG APP2 (574 bytes)
JPEG APP1 (14473 bytes)
  Rewriting XMP
    [nothing changed in XMP]
    [XMP rewritten with no changes]
JPEG DQT (130 bytes)
JPEG DRI (2 bytes)
JPEG APP14 (12 bytes)
JPEG SOF0:
JPEG DHT (184 bytes)
JPEG SOS
    1 image files updated

I guess what I need to understand is, where would I find the tag you're after? Exiftool appears to take notice of it but I can't seem to find it in the output. (exiftool -a -G -u 20241027_Virginia_Water_EOS_50D_IMG_3383_MOD_20241028.JPG)
image

At the same time doing some quick search Phil has suggested very recently that such transformations aren't possible: https://exiftool.org/forum/index.php?topic=16545.0
... so I'm a bit unsure. But in the first instance we'd need to be able to read and identify that particular tag.

@StarGeekSpaceNerd
Copy link

StarGeekSpaceNerd commented Nov 3, 2024

This question led me down a GPS rabbit hole. I believe technically, hdop or pdop should be saved to the GPSDop tag in EXIF, and I'm going to post this as a suggestion on the exiftool forums.

But it probably doesn't belong in GPSHPositioningError. I'm going by ChatGPT, which of course, should be double-checked. But it says that DoP values are not measurements, such as meters. It's a multiplier against the baseline accuracy. GPSHPositioningError instead "indicates horizontal positioning errors in meters" according to the EXIF spec.

For what it's worth, here's the ChatGPT session.

But as your link to the exiftool forums says, hdop/vdop/pdop cannot currently be copied from a GPS track by exiftool.

I suspect that @tarbault is user Mobilis on the exiftool forums based upon re-reading that thread.

@nemethviktor
Copy link
Owner

As always, thanks for the valuable input;)

So yes I think it's currently not something I can do but if Phil implements it in ET I can then transfer that into GTN

@StarGeekSpaceNerd
Copy link

StarGeekSpaceNerd commented Nov 3, 2024

Digging further down the rabbit hole, it looks like the only time exiftool will geotag GPSHPositioningError is when it encounters accuracy_horizontal which appears in opentrack GPX files. Source of that addition.

Currently, the only thing exiftool does with hdop/pdop is compare it to the GeoMaxHDOP/GeoMaxPDOP api options (see here).

@tarbault
Copy link
Author

tarbault commented Nov 4, 2024 via email

@nemethviktor
Copy link
Owner

Hi,

I think there are two separate issues here.
The simple one, "is it possible to write that particular tag"? That is a yes and if you just do

exiftool -GPSHPositioningError=0.2 d:\temp\20241027_Virginia_Water_EOS_50D_IMG_3383_MOD_20241028.JPG

You'll see it in the file:
image

The other is whether we can read that tag from your gpx/txt file and then relay it further and at the moment I think that's not possible because ET doesn't read that parameter as part of the gpx import.

@tarbault
Copy link
Author

tarbault commented Nov 4, 2024 via email

@nemethviktor
Copy link
Owner

nemethviktor commented Nov 4, 2024

No worries. If Phil adds the feature into ET i'll make sure to get back to you and then we can discuss how best to do this. :) - prob keep the ticket open for now so I can see it otherwise might forget.

@tarbault
Copy link
Author

tarbault commented Nov 4, 2024 via email

@StarGeekSpaceNerd
Copy link

On the exiftool side, if the GPSDop tag is filled and assuming 5 meters for the baseline range error, the exiftool command would be

exiftool "-GPSHPositioningError<${GPSDop;$_*=5}" /path/to/files/

This command creates backup files. Add -overwrite_original to suppress the creation of backup files. Add -r to recurse into subdirectories. If this command is run under Unix/Mac, reverse any double/single quotes to avoid bash interpretation.

@tarbault
Copy link
Author

tarbault commented Nov 4, 2024 via email

@StarGeekSpaceNerd
Copy link

Note that exiftool doesn't currently fill the GPSDop tag from a GPS track. I suggested doing so and filling the GPSMeasureMode mode in this exiftool forums thread.

@tarbault
Copy link
Author

tarbault commented Nov 5, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants