XML format
GPX
The interchange format for GPS waypoints, routes and recorded tracks.
GPX separates three things that look similar: waypoints are standalone points, routes are planned sequences, and tracks are recorded ones. Devices and apps disagree about which to emit, so the same activity can arrive in any of the three shapes.
Its files are repetitive and large — thousands of near-identical <trkpt> elements — which makes them a good case for structural extraction rather than reading the document itself.
Constraints that bite
- Waypoints, routes and tracks are distinct structures; consumers must handle all three.
- lat and lon are attributes on the point, while elevation and time are child elements.
- GPX 1.0 and 1.1 use different namespace URIs.
- Extensions are namespaced and vendor-specific — heart rate and cadence are not core GPX.
- Root element
<gpx>- Media type
application/gpx+xml- Extensions
.gpx- Namespaces
http://www.topografix.com/GPX/1/1
- XMLDir label
xml
A minimal valid document
Every example on this site is checked against the same parser the workspace uses, so what you see below is known to be well-formed.
<?xml version="1.0" encoding="UTF-8"?>
<gpx version="1.1" creator="Example"
xmlns="http://www.topografix.com/GPX/1/1">
<trk>
<trkseg>
<trkpt lat="52.2297" lon="21.0122"><ele>113</ele></trkpt>
</trkseg>
</trk>
</gpx>Get started
Bring order to the XML your team can't afford to ignore.
Create a free account and get a private workspace to search, validate, diff, and monitor your XML feeds, sitemaps, schemas, and vendor integrations.