Problem Geotagging + Arguments file

Started by Andreas Spindler, April 03, 2011, 05:56:38 PM

Previous topic - Next topic

Andreas Spindler

Hi,

on the exiftool geotagging page I read that one can specify multiple track log files.  Exiftool then would concatenate them and apply them simultaneously. So I wrote a shell script that creates an arguments file enumerating all track log files I have collected.

# geotags.args
-P
-r
-overwrite_original
-geotag=track.nmea
-Geotime<DateTimeOriginal

Good news first. This worked:

$ which exiftool # under Cygwin with Image::ExifTool cpan'd
/usr/local/bin/exiftool
$ exiftool -ver
8.45
$ exiftool -v2 -@ geotag.args /cygdrive/h/foto/Speicherkarten/zoo-frankfurt

Loaded 37 points from GPS track log file '/cygdrive/h/foto/Speicherkarten/zoo-frankfurt/track.nmea'
     GPS track start: 2011:01:16 10:49:16 UTC
     GPS track end:   2011:01:16 13:12:33 UTC
Writing File:Geotag
======== /cygdrive/h/foto/Speicherkarten/zoo-frankfurt/2011-01-16/P1161918.jpg
Setting new values from /cygdrive/h/foto/Speicherkarten/zoo-frankfurt/2011-01-16/P1161918.jpg
 Geotime value:   2011:01:16 09:37:47 UTC
Nothing changed in /cygdrive/h/foto/Speicherkarten/zoo-frankfurt/2011-01-16/P1161918.jpg
======== /cygdrive/h/foto/Speicherkarten/zoo-frankfurt/2011-01-16/P1161919.jpg
Setting new values from /cygdrive/h/foto/Speicherkarten/zoo-frankfurt/2011-01-16/P1161919.jpg
 Geotime value:   2011:01:16 09:38:06 UTC
Nothing changed in /cygdrive/h/foto/Speicherkarten/zoo-frankfurt/2011-01-16/P1161919.jpg
======== /cygdrive/h/foto/Speicherkarten/zoo-frankfurt/2011-01-16/P1161926.jpg
Setting new values from /cygdrive/h/foto/Speicherkarten/zoo-frankfurt/2011-01-16/P1161926.jpg
 Geotime value:   2011:01:16 10:19:33 UTC
Writing MIE-GPS:GPSLatitude
Writing XMP-exif:GPSLatitude if tag exists
Writing GPS:GPSLatitude
   .
   .


Cool. Exiftool sorts everything together! Alas I wasn't able to specify more than one GPS data file.

Not working:

# geotags.args
-P
-r
-overwrite_original
-geotag file1.nmea
-geotag file2.nmea
-Geotime<DateTimeOriginal

Next I re-exported the tracks as GPX, but also without success:

# geotags.args
-P
-r
-overwrite_original
-geotag file1.gpx
-geotag file2.gpx
-Geotime<DateTimeOriginal

Also not working:

# geotags.args
-P
-r
-overwrite_original
-geotag *.nmea
-geotag *.gpx
-Geotime<DateTimeOriginal

Since this is an arguments file it should not require quotes, but in my desparation I also tried:

# geotags.args
-P
-r
-overwrite_original
-geotag '*.nmea'
-geotag '*.gpx'
-Geotime<DateTimeOriginal


None of the above worked. In each case exiftool does not print the "Loaded n points from GPS track log file yourfile.nmea" message.
Instead it peacefully dumps tons of metadata from my image files, presumably with respect to -v2, nearby completely ignoring the -geotag arguments fed to it.

On the geotagging page (http://www.exiftool.org/geotag.html) there is no example using more than one track file; so my experiments are based on the description at the top of the page: "Multiple GPS log files may be loaded simultaneously by using more than one -geotag option (or by using wildcards in the filename argument for the -geotag option [...]). This allows batch processing of images spanning different tracks with a single command."

Sounds promising.
What am I doing wrong here?
Maybe I have to specify -geotag=x, the pseudo-tag, just once, parallel to -geotag, the option?
But then, with which value?

Thanks in advance,
Andreas

Phil Harvey

Hi Andreas,

You fell prey to a common .ARGS file problem:  You need one argument per line, not one option per line.

So either

-geotag
file1.nmea


or

-geotag=file1.nmea

will work.  But

-geotag file1.nmea

is wrong.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Andreas Spindler

Hi Phil,

thank you for your quick and effective ( ::) ) response. Indeed I forgot that argument files contain one argument per line, not one option per line (http://www.exiftool.org/exiftool_pod.html#other_options).

Then I suppose a general arguments file

-P
-r
-overwrite_original
-geotag
tracks/*.nmea
-geotag
tracks/*.gpx
# end of geotag.args

etc. also works to read any track log file? I'll try it.

Thanks for your work, Phil.
Without exiftool the photographic world would be a few stops darker.  :'(  ;)