Inverse geotagging and time zones

Started by papa_sierra, October 28, 2024, 06:13:28 PM

Previous topic - Next topic

papa_sierra

Thank you, the various timestamps finally work.
The reason I am including the api settings with 10000 seconds is that the photos were taking on a 4-hour flight with large (2h+) gaps between GPS fixes. I'd like to interpolate position between valid fixes. Do these api calls not achieve that?
Best Regards
papa_sierra

StarGeek

Quote from: papa_sierra on November 16, 2024, 04:50:53 AMI'd like to interpolate position between valid fixes. Do these api calls not achieve that?

They do, but as you've seen, it covers up the error when the incorrect UTC/time zone is used. But that should be fixed now.
"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

maison

Quote from: Phil Harvey on October 28, 2024, 09:48:59 PMThe necessary gymnastics is not for the faint of heart:

${datetimeoriginal#;my $tz=$self->GetValue("OffsetTimeOriginal");$tz=~tr/-+/+-/;ShiftTime($tz);DateFmt("%Y-%m-%dT%H:%M:%S%fZ")}

Here I used OffsetTimeOriginal instead of OffsetTime becaue this is the one that corresponds to DateTimeOriginal.

The GetValue method must be used to get the value of another tag from inside an advanced formatting expression.  The ShiftTime helper function is used to shift the time, but first I had to change the sign by translating - to + and visa versa.

- Phil

Thank you Phil. It took me a while to understand why I wasn't able to use the gpx file that I created from geotagged photographs to geotag the neighbouring missing tags.

In my opinion, the GPX file created should use the UTC timestamps when writing in the gpx file by taking into account the Offset time, rather than having to enter such a long formula. Most users won't find this formula that I copied without being able to create it myself.

While I can't see any reason against it, there are two strong reasons to use the UTC directly:
  • UTC is standard for in gpx files, whereas local time is not expected.
  • If you reuse the same .gpx file exiftool produces with local time, you will have errors because of the offset time. So exiftool is not compatible between option -p gpx.fmt that creates the file and option -geotag that uses the same file.

Phil Harvey

Quote from: maison on April 19, 2025, 06:08:39 AM1. UTC is standard for in gpx files, whereas local time is not expected.

I have GPX files that don't use UTC from a number of sources.

Quote2. If you reuse the same .gpx file exiftool produces with local time, you will have errors because of the offset time. So exiftool is not compatible between option -p gpx.fmt that creates the file and option -geotag that uses the same file.

I don't think this is true.  The -geotag option should honour time zone of the timestamps in the input file.

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

maison

Then I don't understand why I had a series of photographs in one day with the same camera and unfortunately the GPS took a while to start, so some are geotagged, some are not. I created a .gpx file from the geotagged photographs with the -p option. Then I ran -geotag on the other photographs in the middle of the series, some taken less than one minute before the former, so before the GPS fix. exiftool couldn't set coordinates for them. It took me a long time to understand that it didn't realise it has to use an offset time, but it ignored it. Only by searching the forum and using this complicated formula I was able to reuse the same gpx file to correctly geotag all the photographs.

Phil Harvey

There must be something wrong with the way you've written the time zones in your GPX file, but without more information I can't be more specific.

Use the -v3 option when geotagging to see what times are being used.  This should help explain things.

- 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

Here's an example from a previous post of what you should look for with the -v3 option
Quote from: StarGeek on December 07, 2023, 11:34:03 AMRun your command again on a single file and add the -v3 option.  You will want to look through the output for lines that look like this
Loaded 1 points from CSV-format GPS track log file 'test.csv'
  GPS track start: 2023:03:16 18:00:00.000 UTC
  GPS track end:   2023:03:16 18:00:00.000 UTC
Writing File:Geotag
======== y:/!temp/Test4.jpg
Setting new values from y:/!temp/Test4.jpg
  Geotime value:   2023:03:16 18:00:00.000 UTC (local timezone is -07:00)

Look at the "Geotime value" listed under the file and make sure it is located between the "GPS track start" and "GPS track end" time stamps.  If it is not then you need to adjust the time.  The most likely situation is that it will be off by your time zone.
"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