Export multiple .gpx files from multiple folders

Started by Martla, February 13, 2019, 05:12:02 AM

Previous topic - Next topic

Martla

Hello,

I was wondering if it is possible to export multiple .gpx files from multiple folders in one go?
I have over 100 folders with  different image sets and it is unimaginable to run the process one by one.

Thanks,
Erekle

Phil Harvey

Hi Erekle,

ExifTool can almost do what you want with this command:

exiftool -p test.fmt -W+ %dout.gpx -r DIR

and this "test.fmt" file:

#[SECT]<?xml version="1.0" encoding="utf-8"?>
#[SECT]<gpx version="1.0"
#[SECT] creator="ExifTool $ExifToolVersion"
#[SECT] xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
#[SECT] xmlns="http://www.topografix.com/GPX/1/0"
#[SECT] xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd">
#[SECT]<trk>
#[SECT]<number>1</number>
#[SECT]<trkseg>
#[IF]  $gpslatitude $gpslongitude
#[BODY]<trkpt lat="$gpslatitude#" lon="$gpslongitude#">
#[BODY]  <ele>$gpsaltitude#</ele>
#[BODY]  <time>${gpsdatetime#;DateFmt("%Y-%m-%dT%H:%M:%SZ")}</time>
#[BODY]</trkpt>


The only problem is that the output GPX files won't be properly terminated, and you'll have to manually add these lines to each one to make a valid GPX file:

</trkseg>
</trk>
</gpx>


I haven't figured out how to do this automatically with ExifTool.

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