beacen.

GPX internals field answer 025

What happens when a GPX track has multiple segments?

The short answer

A GPX track may contain several track segments, each holding points that are logically connected in order. A new segment marks a break in asserted continuity, commonly after reception loss or a stopped receiver. It does not automatically mean a new route, and software should not assume a straight travelled line between segment endpoints.

Inside a track

A segment marks one continuous run of connected track points.

A GPX track is not necessarily one uninterrupted list. The track element, written as <trk>, can contain several <trkseg> elements. Each segment then contains its own ordered sequence of <trkpt> points.

The GPX 1.1 schema describes the points within a segment as logically connected in order. The boundary between two segments says the opposite: the file does not assert that the final point of one span connects directly to the first point of the next.

This is a structural break, not a second route. One named track can still be the record of a single outing even when it has two, five or many segments.

Why the break exists

Reception loss and a stopped receiver are the standard examples.

Topografix gives two explicit reasons to begin a new segment: GPS reception was lost, or the receiver was turned off. Recording software can use the same structure whenever it needs to preserve a discontinuity rather than inventing positions for a period with no usable track data.

  • A pause in reliable positionsA wooded ravine, deep cutting or indoor stop may leave no defensible line between two observations.
  • A recording interruptionStopping and later resuming a device can produce another continuous span within the same track.
  • An export decisionSoftware may retain source breaks, split a long log, or combine several continuous spans under one track name.

The schema does not assign a universal meaning such as rest, overnight stop or transport to a segment boundary. Those interpretations require other evidence, especially timestamps and the surrounding geometry.

What changes

The gap should not silently become travelled distance.

A segment-aware map can draw each span separately. If software joins every point in the document without respecting segment boundaries, it may add a straight line across the gap. That line is an interpretation created by the software, not geometry supplied by the GPX track.

Distance calculations face the same choice. Adding the distances between consecutive points within each segment describes the recorded spans. Adding the distance between the last point of one segment and the first point of the next also measures the unrecorded gap. That can inflate the result, particularly when recording resumed far away.

A segment boundary preserves uncertainty. Joining across it replaces that uncertainty with an invented straight connection.

Before using it

Inspect both the visible spans and the space between them.

  1. Count

    See how many segments the track contains.

    A text inspection reveals each <trkseg>. A map may hide the distinction if the endpoints nearly touch.

  2. Compare

    Look at the last and first points around every break.

    A few metres may indicate a brief interruption. A large separation needs an explanation before the file is used for navigation.

  3. Review

    Check timestamps when they exist.

    They can show the length of the unrecorded interval, but they cannot reveal the path taken during it.

  4. Keep

    Preserve the original structure.

    If you deliberately join or edit segments, save a new copy and inspect the new line rather than overwriting the source.

Sources & scope

What this answer is based on.

The GPX schema defines segment structure and gives reception loss or a switched-off receiver as examples. It does not assign a universal real-world reason to every break.