Page 1 of 1
Can track or route be determined from .gpx file?
Posted: Sun May 29, 2022 9:39 pm
by Peobody
I have a number of .gpx files that I have received from fellows riders. I transferred two of them to my XT via the Drive app and discovered that one of them is a track. I looked at the two .gpx files with Notepad and see a difference in the metadata but not a quick easy way to identify one from the other. Does anyone know if there is a certain search term that would do it?
Re: Can track or route be determined from .gpx file?
Posted: Sun May 29, 2022 10:27 pm
by jfheath
A large number of tracks, routes and / or waypoints can be defined in the same gpx file.
They are each defined by a start and end 'tag' (eg <trk>, <rte>, <wpt>) and end with a similar tag eg (</trk>, </rte>, </wpt>)
However, since the 3 tag can be followd by other information inside the < >, then you can search for just the first 4 characters.
<trk
<rte
<wpt
Anything between the <trk> and the </trk> tags are all to do with the same track (similarly for routes and waypoints) - and lines will contain other 'tags' - eg <trkpt>, <rtept>
But the start of each track, route or waypoint - ie the first few lines - will let you know what the track, route or waypoint is called.
More info if you want it here
https://www.topografix.com/GPX/1/1/
But be warned that the gpx file format standrads allow each developer to include their own definitions - or extensions - to the standard format.
Re: Can track or route be determined from .gpx file?
Posted: Mon May 30, 2022 12:46 pm
by Peobody
Thank you!