help on filling in custom tags from GPX

Started by Mobilis, October 10, 2024, 07:37:21 AM

Previous topic - Next topic

Mobilis

Hello,
Sorry if this is a newbie question, but... I am !

I'm on windows.

So I want to use GPX files that contain that time of information:
<trkpt lat="45.61840542290545"
       lon="5.848490514201983">
<ele>433.8934205596867</ele>
<time>2024-10-03T02:21:27.000Z</time>
<extensions>
<gpxtpx:TrackPointExtension>
<gpxtpx:bearing>357.86993</gpxtpx:bearing>
<gpxtpx:speed>0.0</gpxtpx:speed>
</gpxtpx:TrackPointExtension>
</extensions>
<geoidheight>48.5</geoidheight>
<src>gps</src>
<sat>39</sat>
<hdop>0.9</hdop>
<vdop>1.6</vdop>
<pdop>1.8</pdop>
</trkpt>

and I want to use the values present there for hdop, vdop, pdop and sat into corresponding GPS: tags

I have set the .ExifTool_config as this (changed only these line)
    # the Geotag feature writes these additional GPS tags if available:
    'Image::ExifTool::GPS::Main' => {
        0xd000 => {
            Name => 'Accuracy',
            Writable => 'rational64s',
        },
        0xd001 => {
            Name => 'hdop',
            Writable => 'rational64s',
        },
        0xd002 => {
            Name => 'vdop',
            Writable => 'rational64s',
        },
        0xd003 => {
            Name => 'pdop',
            Writable => 'rational64s',
        },
        0xd004 => {
            Name => 'sat',
            Writable => 'rational64s',
        },

And when I use a batch containing this
exiftool -config .ExifTool_config -n -f -overwrite_original "-Geotime<${CreateDate}+01:00" -geotag "D:\# photo works\DOPtest\*.gpx" "-GPS:hdop=${<hdop>}" "-GPS:vdop=${<vdop>}" "-GPS:pdop=${<pdop>}" "-GPS:sat=${<sat>}" "D:\# photo works\DOPtest"

I get this error:
Warning: Not a floating point number for GPS:Hdop
Warning: Not a floating point number for GPS:Vdop
Warning: Not a floating point number for GPS:Pdop
Warning: Not a floating point number for GPS:Sat
    1 directories scanned
  11 image files updated

but the value for <hdop>0.9</hdop> should be understood as "floating point", no ?

Can someone help me understand what I'm (obviously) doing wrong ?

Thanks a lot


StarGeek

Tag names can't have greater/less than symbols in it. Run exiftool directly on the GPX file to get the actual names exiftool will use for those entries. Odds are it will be "hdop", "vdop", etc, but you need to double check.

Also, this is Common Mistake #5c. You are using an equal sign = which sets tags to a static value, which in this case would be "${<hdop>}", "${<vdop>}", etc, not the numeric values.

Dollar signs and braces aren't needed for these operations (other than the CreateDate*). See Common Mistake #5b.

Your command would be more like this, after double-checking the actual tag names from the GPX file
exiftool -config .ExifTool_config -n -f -overwrite_original "-Geotime<${CreateDate}+01:00" -geotag "D:\# photo works\DOPtest\*.gpx" "-GPS:hdop<hdop" "-GPS:vdop<vdo" "-GPS:pdop<pdop" "-GPS:sat<sat" "D:\# photo works\DOPtest"

* Technically, for this command, the braces aren't necessary for CreateDate either, but that is only because CreateDate is followed by a plus sign, which cannot be used in an exiftool tag name. If it was followed by a minus sign, e.g. $CreateDate-01:00, then the braces are necessary because the minus sign is a valid character for a tag name. But braces won't change anything when using a dollar sign is a requirement, so it's fine to include them.
"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

StarGeek

I almost forgot. When you use custom tags like this, you need to understand that only exiftool will be able to read them and only when you include the config file. Without the config file, they will be unknown tags and won't be listed without the -u (-unknown) option. And in that case they still won't have the names, just the tag location in the EXIF block.

I also haven't checked to see if your config file changes would work, but nothing seems wrong with it after a quick glance.
"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

Unfortunately the list of GPS tags supported by the -geotag option is not user configurable.  The list of tags written is given at the top of this page.

- 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

Thanks for the answers guys !
So basically what I'm trying to do is not possible...
This is strange because even windows 10 when viewing the properties of a ORF file (Olympus raw) list a property named System.GPS.DOP, DOP standing for dilution of position, or accuracy in common tongue.

I asked for this because in naturalist studies, the precision of the coordinates assigned to an observation is an essential parameter, to the point that observations lacking this accuracy value are often simply discarded...

Phil Harvey

ExifTool can write these GPS tags directly, but not from a GPX file using the -geotag option.

See the GPS Tags documentation for a list of supported GPS tags.

- 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: Mobilis on October 11, 2024, 06:58:44 AMThis is strange because even windows 10 when viewing the properties of a ORF file (Olympus raw) list a property named System.GPS.DOP, DOP standing for dilution of position, or accuracy in common tongue.

This is interesting. I see those listings on NEF and CR2 files as well as ORF.

But upon further testing, even though Windows is listing this, it does not actually read the data from the file. So if your intent was to read this data through Windows, you won't be able to do it.

As for DOP, there already is a tag for this, which is GPSDOP. The spec says
QuoteIndicates the GPS DOP (data degree of precision). An HDOP value is written during two-dimensional measurement, and PDOP during three-dimensional measurement.

Though that might be hard to translate to a single value, as you multiple separate values.

And in order to tell whether this value is two or three dimensions, you would set the GPSMeasureMode to 2 or 3
QuoteIndicates the GPS measurement mode. The value '2' shall be recorded in case of two-dimensional measurement (latitude and longitude only) and the value '3' shall be recorded in case of three-dimensional measurement (latitude, longitude, and altitude).

I assume "sat" is for satellites? For that, there is GPSSatellites.
QuoteIndicates the GPS satellites used for measurements. This tag may be used to describe the number of satellites, their ID number, angle of elevation, azimuth, SNR and other information in ASCII notation. The format is not specified. If the GPS receiver is incapable of taking measurements, value of the tag shall be set to NULL.
"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

Thanks for all the added precisions !
So, what I concluded from all this is:
1- some tags do exist already for what I need
2- exiftool can read and write them but not through the geotag function

That answers my question fully, and as I intend to interact with exiftool via C# code, it's a full solution to my question.
So we can consider this closed/
Thanks again.