Hi all,
I can find a lot of useful information about geotagging pics from a gpx file.
I also can find examples of the reverse: create a gpx file from a series of geotagged pics.
What I cannot find is information about how to read metadata of the gpx file itself.
According to online documentation, exitftool doesn't even support the file type .gpx
However, an "exitftool -a mytrack.gpx" essentially provides all information I want to have, I just need some help on how to "grab" it.
Backgrund on what I want to achieve:
Before geotagging my pics from the gps logger's .gpx file, I first need to get the .gpx files from the logger onto my hard drive using a "meaningful" directory structure and file name convention. Different gps loggers provide diffent approaches:
- Some carry the track start date/time in the default file name, others put the track end date/time into the default file name.
- Some do so in local time, others do so im GMT
- Some have a file created/changed date of saving the gpx file at the end of the track, some have a random file create/change date that has nothing to do with the track. (So my current workaround of using file system dates just partially helps.)
What I'm thinking of is:
- Determine the track end date by finding the last track point in the file
- move the file to \somewhere\yyyy-mm-dd\
- rename the file to yyyy-mm-dd-hhmmss.gpx in local time
Then it would show up right at the very same place where photos and videos show up thanks to all the other great features of exiftool and my fancy windows powershell scripts.
Any advise?
See here (https://exiftool.org/geotag.html#GPX) for an example of how to use ExifTool to create a .GPX file from a set of geotagged images.
- Phil
Hi Phil,
thanks for your quick reply, but I don't see how this would help me with what I want to achieve.
My requirement in short: I want to batch-rename .gpx files based on the gps track end timestamp information within in the gpx file.
So how would I grab the _latest_ trackpoint date/time in a tag and use it for renaming the gpx file?
Thanks,
Uwe
Hi Uwe,
Sorry, I was in a hurry and didn't read your post carefully.
Try running "exiftool -s" on the GPX file to see what information is extracted. Add -a to see duplicate tags.
For my GPX sample, the GpxTrkTrksegTrkptTime is what I would use. But since the tag is not defined, the -d option won't work. Also, you want to convert to local time. So I would copy this to the FileModifyDate, which will solve both of these problems:
exiftool "-filemodifydate<GpxTrkTrksegTrkptTime" some.gpx
Unfortunately though, this will be the time of the first trackpoint, not the last.
Then you can move/rename the file from the FileModifyDate, which will be in local time now.
- Phil