T qupkene

qupkene / Tech / The GPX file format

Tech

The GPX file format

It is XML. Once you know the three data types, every import problem becomes obvious.

GPX is a plain XML document. You can open one in a text editor and read it, which is worth doing once, because almost every failed import is visible by eye.

Three data types

Track structure

A trk contains one or more trkseg segments, and each segment contains trkpt points. A new segment means the recording was interrupted, which is why a track that was paused and resumed does not draw a straight line across the map. Each point carries lat and lon as attributes, and usually ele and time as child elements.

Where it goes wrong

Related formats

KML is Google's equivalent and carries styling information GPX does not. FIT is Garmin's compact binary format, much smaller and not human-readable. TCX is an older Garmin XML format oriented at training data. For sharing a route between two different manufacturers' devices, GPX remains the safest choice precisely because it is simple.