What is a GPX file?
Contents: What is a GPX file?
GPX files: key facts
What is a GPX file?
The anatomy of a GPX file
GPX files: key facts
Topic | Comments |
GPX file | • A special text file that can store any combination of routes, tracks and waypoints. • Typically, a file will be one route, one track, or a collection of standalone waypoints like the Scottish Munros. • .gpx is the file name suffix |
GPX route | • A series of manually plotted route points to mark a route. The route points will include their lat/long location and possibly elevation, depending on the planner. • <rtept> in a GPX file. |
GPX track | • A series of track points, recorded by your GPS, of where you went and when. The track points will include location, elevation, date and time. • <trkpt> in a GPX file. • Many route planners export routes as a track. |
GPX waypoints | • In a GPX file these are individual points which identify standalone spot locations. • <wpt> in a GPX file • Confusingly ‘waypoint’ is also used as a general term to describe any navigation point including route points and track points. |
What to use for navigating | • A GPX track is compatible with more tools, but track or route, it doesn’t matter if your device displays it. • A snap-to-path plot or a real track will likely follow paths more closely than a manual plot |
What is a GPX file?
GPX is short for GPS Exchange Format which isn’t a bad description of what GPX files are. They are little text files about the same size as simple ‘Word’ documents. They store the information associated with routes, tracks and waypoints. I’ve explained what they are in Routes, tracks and waypoints.
The GPX format was designed specifically for exchanging GPS information. It is an open standard so anyone can use the format freely. Consequently for GPS navigation duties there is no file type more widely supported. GPX files are used everywhere in GPS-land and work on phones, computers, handhelds and GNSS watches.
Adding a carefully-plotted route to your favourite GPS device using a GPX file will instantly provide an accurate highlighted line on the map for you to navigate by. You can email a GPX file to someone or make one available online for anyone to download. Ready-made route providers like Wikiloc, AllTrails and Outdooractive, all offer their routes to download as GPX files.
If you use any good tool to plot your route then it will provide the option to save your route as a GPX file. GPX is also the file suffix used for these files. eg your-planned-route.gpx
Learn to use GPX files for your routes, tracks and waypoints.
The anatomy of a GPX file
You can open these text files with any text editor (eg Wordpad) and view their contents. Dragging them into a browser window may work too. They mostly contain latitude and longitude coordinates that define the locations of waypoints, track points and route points. If you examine a track recorded by a GNSS unit, you’ll see the timestamps and elevation alongside the lat/long coordinates of the track points.
In a GPX file, ‘tags’ are used to label the data. Route points <rtept>, trackpoints <trkpt> and standalone waypoints <wpt>.
Slightly confusingly a route planner won’t necessarily save your plotted route using ‘route points’. Many save routes as a ‘track’ using track points. This doesn’t really matter. Both formats provide an accurate coloured line on your map. Tracks just happen to be compatible with more devices.
Here’s a simple route I created in Memory Map desktop software (I don’t recommend trying to walk it!). It has just two points. I saved the route using the ‘GPX route’ format. Normally the symbols representing route points default to plain dots but GPX files will save route points with different symbols, so I changed them for this example. A flag for waypoint 1 and a camp, at waypoint 2.
Here’s the key section of the GPX route file I saved. The special type of formatting used for these files is called XML. This is good for storing data and accounts for the angle bracket ‘tags’, that identify what the data is. Coloured for clarity. It’s fairly obvious what’s what. Route point 1 in green, route point 2 in purple.
Here’s a key section from a ‘GPX track’ of a real hike around the Fairfield Horseshoe in the Lake District. One track point in green, the next in purple. Note the elevation and date/timestamps not found in the previous user-created route file.
The grey <trkseg> in the picture above denotes the beginning of a series of trackpoints that belong together, a track. </trkseg> is used to mark the end of the track (not shown). It’s quite possible to make a GPX file with many tracks in the file, each one marked with <trkseg> at the start and </trkseg> at the end. The same is true of routes and waypoints.
Much of the time GPX files are used to share just one route, one track or maybe a collection of mountain peaks. However, it’s a flexible format and any combination of the three can be shared with a single file.
‘Hiking Guy’ aka Chris Hazzard (mountain guide) has a good article called What is a gpx file which has more detail.
Techie information on the GPX file format at Topografix.com