Creating gpx file from geotagged images problem

Started by marciano, October 13, 2010, 11:32:19 AM

Previous topic - Next topic

marciano

Hello,
I am using the last version of exiftool on Snow Leopard.
I have a folder named 1AA containing several photos, much of them geotagged.
There is also gpx.fmt containing
Quote#[HEAD]<?xml version="1.0" encoding="utf-8"?>
#[HEAD]<gpx version="1.0"
#[HEAD] creator="ExifTool $ExifToolVersion"
#[HEAD] xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
#[HEAD] xmlns="http://www.topografix.com/GPX/1/0"
#[HEAD] xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd">
#[HEAD]<trk>
#[HEAD]<number>1</number>
#[HEAD]<trkseg>
<trkpt lat="$gpslatitude#" lon="$gpslongitude#">
<ele>$gpsaltitude#</ele>
<time>$gpsdatetime</time>
</trkpt>
#[TAIL]</trkseg>
#[TAIL]</trk>
#[TAIL]</gpx>
Running
exiftool -r -if '$gpsdatetime' -fileOrder gpsdatetime  -p gpx.fmt -d %Y-%m-%dT%H:%M:%SZ 1AA > 1AA.gpx
I get
'1 files failed condition'
and 1AA.gpx is empty.
If I remove the 'if' condition then I get
'File not found: 1AA'.

Then I created a test dir and copied 5 photos from 1AA dir and executed
exiftool -r -if '$gpsdatetime' -fileOrder gpsdatetime  -p gpx.fmt -d %Y-%m-%dT%H:%M:%SZ test > test.gpx
and it did the job:
'1 directories scanned
5 image files read'

test.gpx content is
Quote<?xml version="1.0" encoding="utf-8"?>
<gpx version="1.0"
creator="ExifTool 8.34"
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">
<trk>
<number>1</number>
<trkseg>
<trkpt lat="-18.4812083333333" lon="-70.32517">
<ele>138</ele>
<time>2010-09-16T23:04:15Z</time>
</trkpt>
<trkpt lat="-18.4812533333333" lon="-70.325155">
<ele>140</ele>
<time>2010-09-16T23:04:40Z</time>
</trkpt>
<trkpt lat="-18.4812533333333" lon="-70.3251116666667">
<ele>139</ele>
<time>2010-09-16T23:04:55Z</time>
</trkpt>
<trkpt lat="-18.4812216666667" lon="-70.3250666666667">
<ele>138</ele>
<time>2010-09-16T23:05:22Z</time>
</trkpt>
<trkpt lat="-18.48122" lon="-70.325065">
<ele>139</ele>
<time>2010-09-16T23:05:28Z</time>
</trkpt>
</trkseg>
</trk>
</gpx>
So I guess there's a problem with one or more files inside 1AA dir that causes those strange error messages.
How can I solve this issue?
Thank you

Phil Harvey

What is the output of "ls -l 1AA" when the current directory is the same as with the exiftool command?

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

marciano

Sorry to bother you.
It was a dumb thing: there was a blank space at the end of the dir name.
Thank you.

Phil Harvey

That would do it.  I was guessing that you may have typed an "l" instead of a "1", but the space will do the same thing.

You can avoid typing the directory name (and hence avoid typing errors) in OS X by dragging and dropping the folder into the Terminal window.

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

marciano

Well, 1AA was not the real name! This is a good tip, I copy/paste from Get Info file/folder.
Thank you, this is a great tool!