TrailCam

Guides

Why does a GPX file have multiple track segments?

Open a GPX file that was paused partway, interrupted, or stitched together from more than one recording, and you may find the points inside it are not one continuous list but several, each grouped into its own segment within a single track. That is not damage and it is not the same thing as two separate files — it is the format's own way of marking a break in an otherwise unbroken recording.

The short answer

A GPX track — a <trk> element — does not have to hold one unbroken list of points. It is a container for one or more track segments, each written as a <trkseg>, and each segment is its own run of points in time order. A track with three segments still reads as a single file and a single activity to almost every viewer; it just means the points inside it are grouped into three continuous stretches instead of one.

A new segment is the format's own way of marking a break without starting a new file. The coordinates on either side of the boundary are exactly as real as any other point — nothing about them changes. What changes is the implicit promise a track normally makes: that consecutive points were recorded moments apart. A segment boundary is the file telling anything that reads it not to assume that across this particular join.

What actually starts a new segment

A handful of situations produce one, and none of them mean the recording went wrong:

  • A deliberate pause and resume. Stop for a rest, tap pause, tap resume later — some apps close the current segment at the pause and open a fresh one at the resume, so the break is recorded in the file itself rather than only remembered by the app that made it.
  • An interruption the phone did not choose. If a device loses the sky for a stretch — a long tunnel, a dead battery that gets recharged — a recorder that resumes afterwards may start a new segment rather than pretend the missing minutes never happened.
  • A merge that deliberately keeps the join visible. A hand-merge done by pasting one file's points into another's single segment flattens the two recordings into one continuous-looking stretch. A purpose-built merging tool more often keeps the two as separate segments inside one track instead, so the fact that there was a break between them survives the merge rather than getting erased by it.
  • A multi-day trek written as one file. Rather than a separate GPX for each day, some tools write the whole trip as a single track with a new segment starting each morning — one file for the trip, with the days still distinguishable inside it.

What a map does with the break

How the gap actually looks depends entirely on whatever is reading the file, and that is where most of the confusion starts. A viewer that understands segments leaves a visible gap on the map, or draws each segment as its own line. A viewer that ignores segment boundaries and simply connects every point in the file, in order, draws a straight line from the last point of one segment to the first point of the next — which can look exactly like the kind of spike a single bad GPS fix produces, for a completely different reason. A spike is one misplaced point surrounded by good ones; a segment jump is a deliberate structural break the file itself declares, spanning whatever distance and time actually separated the two stretches of recording.

Totals are usually built more carefully than the map is drawn. A tool that sums distance segment by segment adds up only the ground actually covered inside each one, and does not add the straight-line hop between segments as if someone walked it. Elapsed time, on the other hand, is ordinarily still first timestamp to last timestamp regardless of segments, because that is what elapsed time already means everywhere else: the whole time you were out, gap included.

What TrailCam does

TrailCam pauses and resumes recording exactly when you tap to pause it, rather than guessing a stop from your GPS speed, and the paused stretch stays out of the moving time it reports. It exports the finished route as GPX 1.1, or as a CSV summary, for a single walk or your entire history at once. Export is part of the optional TrailCam Pro upgrade; the app itself is free to download.

Questions

Does having more than one track segment mean my GPX file is broken?
No. Multiple segments inside one track is normal, valid GPX. It usually means the recording was paused and resumed, interrupted, or deliberately merged in a way that kept the break visible rather than flattening it away.
Will a segment break show up as a gap on the map, or a straight line across it?
It depends on the viewer. Software that understands track segments leaves a gap or draws each one separately; software that just connects every point in the file in order draws a straight line across the join, which can look like a GPS spike even though the cause is completely different.
Does pausing a recording always create a new track segment in the exported file?
Not necessarily — it depends on how the recording app chooses to write its export. Pausing reliably keeps that stretch out of your moving time; whether it is also stored as a literal new segment in the GPX file is an implementation detail that varies between apps.

Recording your own routes

TrailCam is an iPhone app that records your route with GPS, keeps video clips, photos and voice notes pinned to the spot where you took them, and exports the result as GPX 1.1 or CSV. It is free to download.

Download on the App Store