ExifTool Forum

ExifTool => Newbies => Topic started by: andrew1015 on February 03, 2012, 02:50:36 PM

Title: Export to gpx file
Post by: andrew1015 on February 03, 2012, 02:50:36 PM
Newbie, I'll admit! I am trying to extract gps data from a folder of camera images and save to a .gpx file. I only need date/time and lat/long data, but am having some difficulty with a command (Windows) line construction.
I have searhced the forum and see some similar posts, but nothing on point with what I am trying to do. Any help is appreciated, and I am willing to learn as much as I can. Thanks
Title: Re: Export to gpx file
Post by: Phil Harvey on February 03, 2012, 07:30:07 PM
This isn't what I would call a newbie question, since it involves some more tricky features of ExifTool.

This is explained in the reverse geotagging (https://exiftool.org/geotag.html#Reverse) section of the ExifTool geotagging documentation.  Let me know if you have any problems after reading this.

- Phil
Title: Re: Export to gpx file
Post by: andrew1015 on February 04, 2012, 03:32:31 PM
Hi Phil and thank you for the prompt response.

Based upon your recommendation for reading, I was able to create waypoints (using gpx_wpt.fmt) to a gpx file from some test images, and plot them on another piece of software. I used "exiftool.exe -gpsdatetime -p gpx_wpt.fmt TestPics > out4.gpx" and am trying to bring over the time, but only filename, lat and long show up.
The order of the times is not important.

In the end, I would like to be able to map images (not using google earth kml) with associated dates/time. It seems that creating a normal .gpx gives me a tracklog and that is not really what I am trying to do.

Any assistance would be appreciated.
Title: Re: Export to gpx file
Post by: Phil Harvey on February 04, 2012, 08:09:19 PM
Hi Andrew,

If your source images contain both GPSDateStamp and GPSTimeStamp, then ExifTool's GPSDateTime tag should be generated and written to the output GPX log.  If both are not available, you can change "$gpsdatetime" in the format file to something else (like $datetimeoriginal for example), but the only problem here is that it should be in UTC, not local time.

- Phil
Title: Re: Export to gpx file
Post by: andrew1015 on February 05, 2012, 09:02:27 AM
Thanks, Phil. The images have a gpstimestamp, but no gpsdatestamp. I guess I am not clear on how to change something in the format file as you suggested, ie, $datetimeoriginal - so I can capture another available tag. Is it in the command line syntax or is it done somewhere else. I am getting closer, thanks to your assistance. I really enjoy using exiftool and amazed at is flexibility.

-Andrew
Title: Re: Export to gpx file
Post by: Phil Harvey on February 05, 2012, 10:08:00 AM
Hi Andrew,

In the print format file (probably named "gpx.fmt"), replace the line

Code: [Select]
#[BODY]  <time>$gpsdatetime</time>
with

Code: [Select]
#[BODY]  <time>$datetimeoriginal</time>
using your favourite plain text editor.

- Phil
Title: Re: Export to gpx file
Post by: andrew1015 on February 06, 2012, 01:58:45 PM
Thanks, Phil. I was able to make that change.

On a slightly related note, I am attempting to export the gpstimestamp data to a .csv, (as an alternative) and it seems that I need to adjust the gpstimestamp from the TAG value to correcly populate the csv filed. The GPS Time Stamp is reported as 15:47:30.22, and csv ignores the "15" and reports time as 47:30.2., so it must be the number of "places" in the time reported ??

 I have tried different -d time formats in my command line to try and adjust the GPS Time Stamp output, but have had no luck. Would like to get to something like 15:47:30, which should correctly export to .csv, and is close enough for my purposes, but everything I have tried returns the same values as in the TAG.

Sorry for being such a noob, but I am a lot further along then I was a few days ago, thanks to your guidance and other posts in the Forum

Thanks

-Andrew

Title: Re: Export to gpx file
Post by: Phil Harvey on February 06, 2012, 02:05:01 PM
Hi Andrew,

I can't reproduce the problem you are having.  Here is a console excerpt:

Code: [Select]
> exiftool a.jpg -gpstimestamp=15:47:30.22
    1 image files updated

> exiftool a.jpg -gpstimestamp -csv
SourceFile,GPSTimeStamp
a.jpg,15:47:30.22

Is the problem just with the software you are using to import the CSV file?  Unfortunately, the -d option doesn't work on time-only values, so this format can't be changed in ExifTool.

- Phil
Title: Re: Export to gpx file
Post by: Phil Harvey on February 06, 2012, 02:29:34 PM
I just tried opening Microsoft Excel and typing "15:47:30.22" into a cell, and it changed to "47:30.2".

Dumb.  I wonder why it does this.  It seems as if this is your problem.

I can change the format of the cell in Excel so it displays as "15:47:30", but the limited choice of formats doesn't let me display the fractional seconds like this.

Normally I don't get into answering questions about other software, but I had a few spare minutes to kill.

- Phil

Title: Re: Export to gpx file
Post by: BogdanH on February 06, 2012, 02:38:44 PM
Hi Phil,

I believe it has to do with PC regional settings which Excel uses. You should try to use "15:47:30,22" instead -or try to find options in Excel, to change this behaviour.
On my PC "15:47:30.22" works ok, but if I use "15:47:30,22", content changes to "47:30,2" -opposite of what's happening on your PC.

Bogdan
Title: Re: Export to gpx file
Post by: andrew1015 on February 07, 2012, 08:52:26 AM
Phil

It appears to be an Excel issue, since I was able to export to another spreadsheet software correctly. So, with yor help, I am able to get the first phase of my project completed - thank you!!

-Andrew