beacen.

GPX internals field answer 027

Does a GPX file include elevation data?

The short answer

A GPX file can include an optional elevation value for each waypoint, route point or track point. GPX 1.1 expresses that value in metres, but points do not have to include it. The core elevation field also does not identify how the height was obtained, so coverage and provenance should be checked before trusting a profile.

The optional value

Elevation belongs to points, not to the GPX line as a whole.

GPX 1.1 represents elevation with the optional <ele> element. A waypoint, route point or track point can each carry one elevation value because all three use the same GPX point structure. The value is expressed in metres, including when the viewing app later displays feet.

A track with 2,000 points may have an elevation at every point, at some points, or at none of them. The file can still be valid in all three cases. GPX requires latitude and longitude for each point, but it does not require <ele>.

There is no single route-level field for total ascent, total descent or highest point in the GPX 1.1 core. Those figures are usually calculated from the sequence of point elevations or supplied through an extension.

Units and reference

The unit is clear. The vertical reference may not be.

The schema is explicit that GPX measurements use metric units and labels <ele> as the elevation in metres of the point. A value of 312.4 therefore means 312.4 metres in the file, not 312.4 feet.

The core elevation element does not carry an attribute naming its vertical datum or measurement method. A nearby <geoidheight> element can state the height of the geoid above the WGS 84 ellipsoid, but it is optional too. Many files provide no such supporting value.

That matters because a height observed by a satellite receiver, an altitude corrected by a barometer and an elevation sampled from a terrain model are different sources. The same path can receive slightly different profiles without either file breaking the GPX syntax. The broader distinction is covered in GPS elevation vs terrain elevation data.

Missing values

An exporter may omit elevation deliberately or simply never have it.

  • A route was drawn in two dimensionsThe planner may have stored only latitude and longitude and left terrain sampling to the receiving service.
  • The receiver did not export altitudeA recording can retain the horizontal positions while leaving the optional elevation field absent.
  • A conversion removed fieldsA simplified or privacy-cleaned export may preserve geometry but discard elevations, times or extensions.
  • Coverage was incompleteSome points may have values while others do not, leaving a profile with holes that software must handle explicitly.

A map service can add elevation later by sampling a digital elevation model. That creates new derived data. It does not recover the original receiver's altitude observations.

Before trusting the profile

Check coverage, shape and provenance rather than one summit number.

  1. Sample

    Inspect points near the beginning, middle and end.

    This quickly reveals whether elevation is absent, complete or intermittent.

  2. Compare

    Look for impossible steps and flat replacements.

    Sudden vertical jumps or repeated zeroes can distort the elevation profile and any derived ascent.

  3. Identify

    Find out whether values were measured or terrain-sampled.

    The creator name, export notes or service documentation may help. The <ele> value alone does not say.

  4. Keep

    Preserve the source before replacing elevations.

    A terrain correction may improve consistency, but it should remain possible to compare it with the original file.

Sources & scope

What this answer is based on.

The GPX schema defines the optional ele and geoidheight elements and metric units. It does not identify the sensor, terrain model or processing used for a given file.