Sourcing geotag data from tcx files created by mapmyhike.com

Started by stephenhartley, October 10, 2016, 10:59:14 AM

Previous topic - Next topic

stephenhartley

I'm attempting to use exiftool to add geocache data sourced from a tcx file using:

exiftool -geotag example.tcx .

However, I get the following errror:

Warning: No track points found in GPS file 'example.tcx' in File:Geotag (ValueConvInv)

The file 'example.tcx' was created by http://www.mapmyhike.com/, and reading it in a text editor shows that trackpoint data is present. 

I've uploaded the full file here: https://gist.github.com/anonymous/58022812034299042916efc5aa322a42

My understanding was that tcx files are supported by exiftool, and I can't see what is wrong with the file I am using; would appreciate any assistance/advice!

Many thanks

Steve

Phil Harvey

There is a lot of extra whitespace that shouldn't be there around each tag value, causing ExifTool to reject the data.

eg.

<Trackpoint>
<Time>
2016-10-09T11:11:25.220661+00:00
</Time>
<Position>
<LatitudeDegrees>
51.3217765466
</LatitudeDegrees>
<LongitudeDegrees>
0.3667430487
</LongitudeDegrees>
</Position>


should be

<Trackpoint>
<Time>2016-10-09T11:11:25.220661+00:00</Time>
<Position>
<LatitudeDegrees>51.3217765466</LatitudeDegrees>
<LongitudeDegrees>0.3667430487</LongitudeDegrees>
</Position>


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

stephenhartley

Thanks Phil, a couple of quick regex find & replaces proved you're correct!  I can understand whitespace between the tags themselves for pretty print reasons, but whitespace within the data is just plain wrong!

I got in touch with the authors of http://www.mapmyhike.com/ to see if there's a reason for this, and to ask them to fix it.  Otherwise, there's an extra step in my workflow to parse the whitespace out.

Thanks again for all your work on ExifTool and continued support answering queries like this, I'm sure the whole community appreciates your efforts.

Steve

Phil Harvey

Hi Steve,

Quote from: stephenhartley on October 10, 2016, 07:02:30 PM
whitespace within the data is just plain wrong!

Exactly.  They should fix this.

Quote
Thanks again for all your work on ExifTool and continued support answering queries like this,

You're welcome.

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

stephenhartley

Given the prevalance of the mapmy* series of apps, I think that wanting to geotag using their tcx data as a source might be a pretty common use case.

I've requested that they correct their export format, but since I don't have a subscription to their service, I'm not expecting a rapid reply.

Hence I've written a short bash script to convert their tcx data to a canonical format that ExifTool can work with.

If it helps anyone else, I've shared it as a gist: https://gist.github.com/stephenhartley/68781ffe81c0c204fd4cdef8eff3e436

<GoogleBait>
MapMyFitness
MapMyRun
MapMyRide
MapMyWalk
MapMyHike
</GoogleBait>