I wanted to know what is the basic difference between a GPX track and route file
4 Answers
A route is a sequence of waypoints, its the plan for your navigation. A track is the recorded path you did actually follow while trying to implement the plan (the route).
As GPX files a different XML schema is used for routes and tracks. Here are examples: http://cycleseven.org/gps-waypoints-routes-and-tracks-the-difference
-
1The link is broken. See the answer below by @fuggi for a working link.– movesonCommented Jul 7, 2020 at 3:35
Originally, a GPX route was supposed to consists of only waypoints important to navigate along them from origin to destination, still allowing differences in the actual track taken due to, for instance, traffic conditions or construction sites. Hence, the GPX track was supposed to consists of a much more dense sequence of actually recorded locations on the way from waypoint to waypoint. A pretty good scheme can be found on Wikipedia.
Since Stefan's link is broken, you will find the latest official GPX definition and documentation at topografix.com.
However, GPX tracks are sometimes used for all purposes: planning tours, navigating (particularly when cycling or hiking) or recording the actual track.
I participate in a cycling group (San Jose Bike Party) that routes a course each month which you can download as a GPX Track or GPX Route. When I upload them into my fitness app (Strava), you can see the difference between a GPX Track and a GPX Route.
Note that the GPX Track contours the roads for the exact route they recorded, but the GPX Route only notes the point-to-point linear segments between the sparse points they recorded. It's up to you or your navigation router to determine how to get from point to point in the GPX Route.
on the technical side, the main differences seem to be:
- name of the tags: "trk" "rte"
- a track has to posess at least 1 segment ("trkseg")
to illustrate, here is a simple bash script to convert a one-line file "foo.gpx" from route to track:
sed -i -e 's|rte>|trk>|g' -e 's|rtept|trkpt|g' \
-e 's|</name><trkpt|</name><trkseg><trkpt|g' \
-e 's|</trkpt></trk>|</trkpt></trkseg></trk>|g' foo.gpx