First Attempts at batch-geotagging a bunch of pictures from a GPS log, Failing…

Started by Bob Blaylock, May 25, 2020, 08:47:04 PM

Previous topic - Next topic

Bob Blaylock

  I'm using the Oliver Betz alternative Exiftool 11.99, under Windows 10.

  In the past, I've geotagged files using a fixed location, and got to where this works quiet well for me.

  But today, I decided to try using a log file generated by the Ultra GPS Logger app on my android phone.  I've got logs in the .GPX, .KML, and .NMEA formats, sitting in my DropBox folder, and a bunch of files on an SD card from my Nikon D3200.  I've verified that the time is correct on my camera (along with the correct time zone) and that the times in the log files (in UTC) cover the correct range, from well before, to well after this pictures were actually taken.

  So, I try to use the following command, in the directory that I want to receive the geotagged files...

    exiftool -o . -OffsetTimeOriginal=08:00 -geotag="T:\Bob\Dropbox\Ultra GPS Logger\2020-03-14_034330.759.gpx" e:\DCIM\100D3200\*

  I have tried the same thing with the .KML and .NMEA files, as well, and get the same result every time.

Warning: Time is too far beyond track in File:Geotime (ValueConvInv) - e:/DCIM/100D3200/DSC_0470.JPG
Warning: No writable tags set from e:/DCIM/100D3200/DSC_0470.JPG
Warning: Time is too far beyond track in File:Geotime (ValueConvInv) - e:/DCIM/100D3200/DSC_0470.NEF
Warning: No writable tags set from e:/DCIM/100D3200/DSC_0470.NEF
Warning: Time is too far beyond track in File:Geotime (ValueConvInv) - e:/DCIM/100D3200/DSC_0471.JPG
Warning: No writable tags set from e:/DCIM/100D3200/DSC_0471.JPG
     ·
     ·
     ·


  And the files  do end up in the current directory, without any geotags.

  What am I doing wrong?

  Reading a few other threads on this forum led me to the thought that perhaps a time zone conversion wasn't taking place correctly, so I tried repeating the command using each of these tags, with the same results.

-OffsetTimeOriginal=-07:00
-OffsetTimeOriginal=07:00
-OffsetTimeOriginal=-08:00
-OffsetTimeOriginal=08:00


  I also tried creating an edited version of the .GPX file, in which I had changed all the times to local time, and using that, again, with the same result.

  For now, I'm going back to the fixed-location method that I've been using, and am going to process this batch using this command...

     exiftool -GPSLatitude=38.4721  -GPSLatitudeRef=N -GPSLongitude=-121.431 -GPSLongitudeRef=W -o . e:\DCIM\100D3200\*

  Fine for this case, where I was in pretty much the same position for every picture, but I'd really like to get the method to work that I was trying to use.

———

  Here's the contents of the .GPX file...

<?xml version="1.0"?>
<gpx version="1.0" creator="Ultra GPS Logger" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.topografix.com/GPX/1/0" xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd">
<!-- segment: 2020-05-25_162109.113 category: Car -->
<trk>
<name><![CDATA[2020-05-25_162109.113]]></name>
<trkseg>
<trkpt lat="38.47210" lon="-121.43059"><ele>-22</ele><time>2020-05-25T23:21:09Z</time></trkpt>
<trkpt lat="38.47214" lon="-121.43063"><ele>-15</ele><time>2020-05-25T23:21:21Z</time></trkpt>
<trkpt lat="38.47209" lon="-121.43062"><ele>-22</ele><time>2020-05-25T23:21:38Z</time></trkpt>
<trkpt lat="38.47204" lon="-121.43064"><ele>-30</ele><time>2020-05-25T23:21:53Z</time></trkpt>
<trkpt lat="38.47208" lon="-121.43069"><ele>-36</ele><time>2020-05-25T23:22:38Z</time></trkpt>
<trkpt lat="38.47212" lon="-121.43071"><ele>-35</ele><time>2020-05-25T23:22:55Z</time></trkpt>
<trkpt lat="38.47206" lon="-121.43073"><ele>-31</ele><time>2020-05-25T23:23:50Z</time></trkpt>
<trkpt lat="38.47201" lon="-121.43073"><ele>-31</ele><time>2020-05-25T23:23:53Z</time></trkpt>
<trkpt lat="38.47196" lon="-121.43075"><ele>-30</ele><time>2020-05-25T23:23:57Z</time></trkpt>
<trkpt lat="38.47198" lon="-121.43079"><ele>-31</ele><time>2020-05-25T23:24:04Z</time></trkpt>
<trkpt lat="38.47202" lon="-121.43084"><ele>-30</ele><time>2020-05-25T23:24:09Z</time></trkpt>
<trkpt lat="38.47206" lon="-121.43087"><ele>-30</ele><time>2020-05-25T23:24:15Z</time></trkpt>
<trkpt lat="38.47210" lon="-121.43091"><ele>-29</ele><time>2020-05-25T23:24:20Z</time></trkpt>
<trkpt lat="38.47213" lon="-121.43095"><ele>-28</ele><time>2020-05-25T23:24:24Z</time></trkpt>
<trkpt lat="38.47215" lon="-121.43102"><ele>-29</ele><time>2020-05-25T23:24:29Z</time></trkpt>
<trkpt lat="38.47220" lon="-121.43101"><ele>-29</ele><time>2020-05-25T23:24:37Z</time></trkpt>
<trkpt lat="38.47224" lon="-121.43102"><ele>-28</ele><time>2020-05-25T23:26:43Z</time></trkpt>
<trkpt lat="38.47220" lon="-121.43098"><ele>-25</ele><time>2020-05-25T23:32:41Z</time></trkpt>
<trkpt lat="38.47216" lon="-121.43094"><ele>-28</ele><time>2020-05-25T23:32:49Z</time></trkpt>
<trkpt lat="38.47211" lon="-121.43095"><ele>-27</ele><time>2020-05-25T23:33:04Z</time></trkpt>
<trkpt lat="38.47205" lon="-121.43094"><ele>-28</ele><time>2020-05-25T23:33:11Z</time></trkpt>
<trkpt lat="38.47200" lon="-121.43090"><ele>-29</ele><time>2020-05-25T23:33:16Z</time></trkpt>
<trkpt lat="38.47200" lon="-121.43084"><ele>-30</ele><time>2020-05-25T23:33:23Z</time></trkpt>
<trkpt lat="38.47203" lon="-121.43079"><ele>-29</ele><time>2020-05-25T23:33:37Z</time></trkpt>
<trkpt lat="38.47204" lon="-121.43086"><ele>-29</ele><time>2020-05-25T23:33:48Z</time></trkpt>
<trkpt lat="38.47205" lon="-121.43080"><ele>-31</ele><time>2020-05-25T23:34:15Z</time></trkpt>
<trkpt lat="38.47206" lon="-121.43079"><ele>-31</ele><time>2020-05-25T23:34:17Z</time></trkpt>
</trkseg>
</trk>
</gpx>
<!-- Summary -->
<!-- Creator: Ultra GPS Logger 3.160f -->
<!-- Name: 2020-05-25_162109.113 -->
<!-- Duration: 00:13:08 -->
<!-- Length: 142.14 -->
<!-- Speed: 0.65 -->
<!-- POI: 0 -->
<!-- Category: Car -->
<!-- From: 38.47210; -121.43059 To: 38.47206; -121.43079 -->
<!-- FromCity: Florin ToCity: Florin -->
<!-- FromUTC: 2020-05-25T23:21:09Z [-7.0] ToUTC: 2020-05-25T23:34:17Z [-7.0] -->
<!-- Trigger: 5 TimeTrigger: 1000 DistTrigger: 0 -->
<!-- MaxSpeed: 6.62 -->
<!-- Stopped: 00:00:00 (0) -->
<!-- AvgMovSpeed: 0.65 -->
<!-- FixSummary: 0+0+0 -->
<!-- Options: U=1;L=1111;B=000;K=1 -->
<!-- DeviceName: Samsung SM-A205U -->
<!-- DeviceId: BobBlaylock_GalaxyA20 -->


  Here's the time data from the files in the source directory...

File Creation Date/Time         : 2020:05:25 16:25:56-07:00
File Creation Date/Time         : 2020:05:25 16:25:58-07:00
File Creation Date/Time         : 2020:05:25 16:26:02-07:00
File Creation Date/Time         : 2020:05:25 16:26:04-07:00
File Creation Date/Time         : 2020:05:25 16:26:06-07:00
File Creation Date/Time         : 2020:05:25 16:26:18-07:00
File Creation Date/Time         : 2020:05:25 16:26:54-07:00
File Creation Date/Time         : 2020:05:25 16:26:56-07:00
File Creation Date/Time         : 2020:05:25 16:27:00-07:00
File Creation Date/Time         : 2020:05:25 16:27:02-07:00
File Creation Date/Time         : 2020:05:25 16:27:06-07:00
File Creation Date/Time         : 2020:05:25 16:27:12-07:00
File Creation Date/Time         : 2020:05:25 16:27:18-07:00
File Creation Date/Time         : 2020:05:25 16:27:22-07:00
File Creation Date/Time         : 2020:05:25 16:27:28-07:00
File Creation Date/Time         : 2020:05:25 16:27:34-07:00
File Creation Date/Time         : 2020:05:25 16:27:38-07:00
File Creation Date/Time         : 2020:05:25 16:29:06-07:00
File Creation Date/Time         : 2020:05:25 16:29:08-07:00
File Creation Date/Time         : 2020:05:25 16:29:10-07:00
File Creation Date/Time         : 2020:05:25 16:29:12-07:00
File Creation Date/Time         : 2020:05:25 16:29:42-07:00
File Creation Date/Time         : 2020:05:25 16:29:44-07:00
File Creation Date/Time         : 2020:05:25 16:29:46-07:00
File Creation Date/Time         : 2020:05:25 16:29:48-07:00
File Creation Date/Time         : 2020:05:25 16:29:50-07:00
File Creation Date/Time         : 2020:05:25 16:29:56-07:00
File Creation Date/Time         : 2020:05:25 16:30:00-07:00
File Creation Date/Time         : 2020:05:25 16:30:02-07:00
File Creation Date/Time         : 2020:05:25 16:30:12-07:00
File Creation Date/Time         : 2020:05:25 16:30:16-07:00
File Creation Date/Time         : 2020:05:25 16:30:30-07:00
File Creation Date/Time         : 2020:05:25 16:30:32-07:00
File Creation Date/Time         : 2020:05:25 16:30:34-07:00
File Creation Date/Time         : 2020:05:25 16:30:36-07:00
File Creation Date/Time         : 2020:05:25 16:30:52-07:00
File Creation Date/Time         : 2020:05:25 16:30:54-07:00
File Creation Date/Time         : 2020:05:25 16:30:56-07:00
File Creation Date/Time         : 2020:05:25 16:30:58-07:00
File Creation Date/Time         : 2020:05:25 16:31:02-07:00
File Creation Date/Time         : 2020:05:25 16:31:04-07:00
File Creation Date/Time         : 2020:05:25 16:31:06-07:00
File Creation Date/Time         : 2020:05:25 16:31:08-07:00


  Here's the directory listing of the source...

Volume in drive E is NIKON D3200
Volume Serial Number is 0000-0000

Directory of e:\DCIM\100D3200

2020-05-25  16:25    <DIR>          .
2020-05-25  16:25    <DIR>          ..
2020-05-25  16:25         9,161,552 DSC_0470.JPG
2020-05-25  16:25        20,652,792 DSC_0470.NEF
2020-05-25  16:26         9,303,698 DSC_0471.JPG
2020-05-25  16:26        20,954,595 DSC_0471.NEF
2020-05-25  16:26         9,485,349 DSC_0472.JPG
2020-05-25  16:26        20,893,875 DSC_0472.NEF
2020-05-25  16:26         9,014,444 DSC_0473.JPG
2020-05-25  16:26        20,466,270 DSC_0473.NEF
2020-05-25  16:26         8,642,791 DSC_0474.JPG
2020-05-25  16:26        20,181,291 DSC_0474.NEF
2020-05-25  16:27         8,648,897 DSC_0475.JPG
2020-05-25  16:27        20,179,951 DSC_0475.NEF
2020-05-25  16:27         9,557,992 DSC_0476.JPG
2020-05-25  16:27        21,032,911 DSC_0476.NEF
2020-05-25  16:27         9,772,266 DSC_0477.JPG
2020-05-25  16:27        21,236,060 DSC_0477.NEF
2020-05-25  16:27         9,163,564 DSC_0478.JPG
2020-05-25  16:27        20,676,733 DSC_0478.NEF
2020-05-25  16:27         9,148,444 DSC_0479.JPG
2020-05-25  16:27        20,426,304 DSC_0479.NEF
2020-05-25  16:27         9,290,696 DSC_0480.JPG
2020-05-25  16:27        20,659,994 DSC_0480.NEF
2020-05-25  16:27         9,066,531 DSC_0481.JPG
2020-05-25  16:27        20,722,827 DSC_0481.NEF
2020-05-25  16:27         9,143,444 DSC_0482.JPG
2020-05-25  16:27        20,755,992 DSC_0482.NEF
2020-05-25  16:29         9,209,817 DSC_0483.JPG
2020-05-25  16:29        21,134,750 DSC_0483.NEF
2020-05-25  16:29         9,394,029 DSC_0484.JPG
2020-05-25  16:29        21,114,776 DSC_0484.NEF
2020-05-25  16:29         9,213,217 DSC_0485.JPG
2020-05-25  16:29        21,003,266 DSC_0485.NEF
2020-05-25  16:29         8,943,005 DSC_0486.JPG
2020-05-25  16:29        20,328,263 DSC_0486.NEF
2020-05-25  16:29         9,002,355 DSC_0487.JPG
2020-05-25  16:29        20,378,843 DSC_0487.NEF
2020-05-25  16:29         9,249,253 DSC_0488.JPG
2020-05-25  16:29        20,542,173 DSC_0488.NEF
2020-05-25  16:29         9,295,041 DSC_0489.JPG
2020-05-25  16:29        20,566,456 DSC_0489.NEF
2020-05-25  16:29         7,833,848 DSC_0490.JPG
2020-05-25  16:29        20,005,645 DSC_0490.NEF
2020-05-25  16:30         9,041,973 DSC_0491.JPG
2020-05-25  16:30        21,063,901 DSC_0491.NEF
2020-05-25  16:30         8,930,072 DSC_0492.JPG
2020-05-25  16:30        21,104,762 DSC_0492.NEF
2020-05-25  16:30         9,348,535 DSC_0493.JPG
2020-05-25  16:30        20,933,194 DSC_0493.NEF
2020-05-25  16:30         9,378,943 DSC_0494.JPG
2020-05-25  16:30        21,063,156 DSC_0494.NEF
2020-05-25  16:30         9,387,418 DSC_0495.JPG
2020-05-25  16:30        21,076,694 DSC_0495.NEF
2020-05-25  16:30         9,426,260 DSC_0496.JPG
2020-05-25  16:30        21,068,059 DSC_0496.NEF
2020-05-25  16:30         9,229,008 DSC_0497.JPG
2020-05-25  16:30        20,534,289 DSC_0497.NEF
2020-05-25  16:30         9,313,477 DSC_0498.JPG
2020-05-25  16:30        20,609,189 DSC_0498.NEF
2020-05-25  16:30         9,309,070 DSC_0499.JPG
2020-05-25  16:30        20,604,984 DSC_0499.NEF
2020-05-25  16:31         9,219,112 DSC_0500.JPG
2020-05-25  16:31        20,527,069 DSC_0500.NEF
2020-05-25  16:31         9,248,282 DSC_0501.JPG
2020-05-25  16:31        20,546,919 DSC_0501.NEF
2020-05-25  16:31         9,226,378 DSC_0502.JPG
2020-05-25  16:31        20,531,254 DSC_0502.NEF
              66 File(s)    986,175,998 bytes
               2 Dir(s)  30,104,977,408 bytes free

Phil Harvey

Quote from: Bob Blaylock on May 25, 2020, 08:47:04 PM
    exiftool -o . -OffsetTimeOriginal=08:00 -geotag="T:\Bob\Dropbox\Ultra GPS Logger\2020-03-14_034330.759.gpx" e:\DCIM\100D3200\*

Writing OffsetTimeOriginal will not affect the time that -geotag uses.  You need to do this through -geotime (see here).

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

Bob Blaylock

Quote from: Phil Harvey on May 25, 2020, 09:22:47 PM
Quote from: Bob Blaylock on May 25, 2020, 08:47:04 PM
    exiftool -o . -OffsetTimeOriginal=08:00 -geotag="T:\Bob\Dropbox\Ultra GPS Logger\2020-03-14_034330.759.gpx" e:\DCIM\100D3200\*

Writing OffsetTimeOriginal will not affect the time that -geotag uses.  You need to do this through -geotime (see here).

- Phil

  I see, now, that in reporting the command line that I originally tried using, I erroneously reported one in which I tried to use the -OffsetTimeOriginal tag to try to work around a suspected time zone issue.  The main form that I was trying to use, I didn't use that tag.  But are you saying that if I use the -geotime tag in that same place, where I tried using the -OffsetTimeOriginal, that I should get the result that I am trying to get?

  I ended up otherwise messing up the set of pictures I was working with, deleted them, and started over, going out to take a whole new set, so the log file is slightly different, but let's try this:

     exiftool -o . -geotime -geotag="T:\Bob\Dropbox\Ultra GPS Logger\2020-05-25_185928.338.gpx" e:\DCIM\100D3200\*

  That seems to have worked.

  Now, not having the attention to read and understand all the documentation,let me make a guess as to what was happening,and you can tell me if I am right.

  Without the -geotime tag, using the -geotag= only works if there are entries in the log file that have the same exact time as the pictures to be tagged, but adding the -geotime tag tells exiftool to interpolate the times and positions, as needed.  Am I anywhere close to right?

Phil Harvey

Quote from: Bob Blaylock on May 25, 2020, 10:39:55 PM
     exiftool -o . -geotime -geotag="T:\Bob\Dropbox\Ultra GPS Logger\2020-05-25_185928.338.gpx" e:\DCIM\100D3200\*

  That seems to have worked.

That command will not work.  The -geotime option requires an argument.

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

Bob Blaylock

Quote from: Phil Harvey on May 26, 2020, 06:01:30 AM
Quote from: Bob Blaylock on May 25, 2020, 10:39:55 PM
     exiftool -o . -geotime -geotag="T:\Bob\Dropbox\Ultra GPS Logger\2020-05-25_185928.338.gpx" e:\DCIM\100D3200\*

  That seems to have worked.

That command will not work.  The -geotime option requires an argument.

- Phil

  Are you sure?  Seems very odd to question you, giving that as far as I know, you're the one person better-qualified to know this program than anyone else, but the command, as I gave it, did, in fact, work, producing exactly the result that I wanted, and the documentation to which you pointed me seems to indicate that it should.

QuoteIf a value for Geotime is not given, it is taken from unformatted value of DateTimeOriginal for each image (as if "-Geotime<DateTimeOriginal#" had been specified)...

  Anyway, my intent is to create a batch file, that I can run, where I give it two arguments, the first being a track file, and the second being the source, and it geotags all the files from the source, placing the tagged versions in the current directory.

  Here's what I now have, based on a bit further reading.

     exiftool -o . -geotag=%1 "-Geotime<DateTimeOriginal#" %2

  What I had before, and seemed to work, was the same, but with just -Geotime instead of "-Geotime<DateTimeOriginal#" %2[/tt].  This seems to work, too, and given your statement that -Geotime is supposed to need an argument, I assume this is the argument you think I should be using to get the result that I want, and in any case, is more correct.

  What I had before, worked, but now, being a pedant, I want to have the most correct possible version of what I intend.

  I can verify, now, that if I include either -Geotime or , I seem to get exactly the result that I intend, but if I don't include one of the other of them, then I get exactly the result I was complaining of at the start of this thread.  You seem to be telling me that -Geotime shouldn't work, and that I need to use "-Geotime<DateTimeOriginal#", though your documentation seems to indicate that -Geotime without an argument should produce the same result as "-Geotime<DateTimeOriginal#", and that seems to match my experience, so far.

Phil Harvey

OK, I belive you that it worked.  But it wasn't designed that way.  When the doc says "If a value for Geotime is not given", it means no -geotime option at all.

You should get a warning like this:

Ignored superfluous tag name or invalid option: -geotime

So it seems that no harm is done.  But this is what you should be doing:

exiftool -o . -geotag=%1 %2

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

Bob Blaylock

Quote from: Phil Harvey on May 27, 2020, 09:36:16 PMBut this is what you should be doing:

exiftool -o . -geotag=%1 %2

  That's what I started out doing, and it got me all the warnings that I reported in my OP.  That's the result I always get, if I do not use the -geotime tag in some form or another.

Phil Harvey

What I'm saying is that just adding "-geotime" alone should have no effect on the command.  Could you try your command with and without -geotime to check this (probably with the -v3 option so we get some more details)?

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