ExifTool Forum

ExifTool => Newbies => Topic started by: engowen on July 20, 2015, 02:44:23 PM

Title: Creating GPX tracks based on years/months in jpgs
Post by: engowen on July 20, 2015, 02:44:23 PM
Hi Phil,

Great tool by the way and it is exactly what i'm looking for.

Based on sample in I found on exiftool the following command line works great in creating gpx.

exiftool -r -if "$gpsdatetime" -fileOrder gpsdatetime -p gpx.fmt -d %Y-%m-%dT%H:%M:%SZ F:\PHOTOS\iOS\ > out.gpx

I have a collection of 30000 pictures taken from my phone over the span of 5 years. I would like to create a separate track by years or year month combination within the same out.gpx, is it possible? Alternatively is it possible to have a condition on $gpsdatetime which check should the first 4 digits belong to certain year? If so how should the syntax be?

Thanks.
Title: Re: Creating GPX tracks based on years/months in jpgs
Post by: Phil Harvey on July 20, 2015, 08:58:22 PM
It would be cool if you could use part of the GPSDateTime value in the output file name, but you can't, so you are stuck with a condition as you suggested.  For example, all tracks in January 2015 would be:

exiftool -if "$gpsdatetime =~ /^2015:01/" ...

- Phil
Title: Re: Creating GPX tracks based on years/months in jpgs
Post by: engowen on July 21, 2015, 04:54:37 AM
Thanks for the syntax, really appreciate your help.
Title: Re: Creating GPX tracks based on years/months in jpgs
Post by: engowen on July 25, 2015, 04:53:17 AM
I'd encountered a problem with date in gpx file. Running the command in windows command prompt has no issue but when i put it in a .bat file and double click the file, the date in gpx showed:

<time>m-H:SZ</time>

instead of

<time>2015-06-21T19:50:54Z</time>

Any idea?

exiftool.exe -fileOrder gpsdatetime -p gpx.fmt -d %Y-%m-%dT%H:%M:%SZ C:\Users\Administrator\Pictures\JPG2GPX > Track.gpx
Title: Re: Creating GPX tracks based on years/months in jpgs
Post by: Phil Harvey on July 25, 2015, 08:55:58 AM
Yes.  You must double all "%" characters in a .BAT file.  The percent has special meaning in a batch file.

- Phil
Title: Re: Creating GPX tracks based on years/months in jpgs
Post by: engowen on July 26, 2015, 04:04:05 AM
Once again thanks for the info.