I.Why the same file gives three different elevation gains
You load the same track into Strava, into Garmin Connect, and into a third GPX reader. Three different elevation gains. A hundred metres apart on a three-hour outing, sometimes more. Which one is right? None of them, and all of them. Elevation gain — the cumulative climb, often called D+ — is not a number stored in the file. It's a calculation done after the file is read, and every tool does it differently.
Two choices, in particular, account for almost all of the gap between figures: the elevation source the tool decides to trust, and the way it filters the noise from that elevation before adding up the climbs. Neither choice is documented clearly by the vendors — which is what makes those post-run conversations so frustrating.
II.What's (and isn't) inside a .gpx file
A GPX file is a long list of points. Each point carries three pieces of information that matter here: its position (latitude and longitude), its elevation in metres, and the exact moment it was recorded. That's all. On a three-hour outing, your watch typically records one point every second — about ten thousand points in the file.
None of those points says « here is the total gain ». No line in the file gives you that number. Elevation gain is always reconstructed after the fact, by watching how elevation moves from one point to the next. And here, everything depends on where that elevation comes from:
- Raw GPS (phone, entry-level watch): elevation is inferred from satellite geometry. Mediocre accuracy, and elevation jitters by ±1 to 2 metres constantly — even when you stand still.
- On-board barometer (Garmin Fenix, Suunto, Coros, high-end Polar): the watch measures atmospheric pressure and converts it to elevation. Much steadier — a few tens of centimetres of noise. But sensitive to the weather: a passing weather front during your outing can quietly add 5 to 10 fake metres if the watch wasn't calibrated at the start.
- « Corrected » elevation (Strava, on paid accounts): the recorded elevation is replaced at read time by elevation pulled from an online topographic map. Very smooth — sometimes too smooth, you lose the steps of a single-track trail or the rolls in a wooded section.
Three sources, three possible numbers — and we haven't even started talking about the calculation itself.
III.The naive method, and why it fails
The most natural way to compute elevation gain is to walk through the track in order and, every time elevation goes up from one point to the next, add the difference. Simple, intuitive — and unusable.
The trouble, as we saw, is that the altimeter jitters. Even motionless, your watch records variations of a metre, sometimes two. On a track of ten thousand points, these tiny oscillations are countless. And because we only add positive variations, the noise never cancels itself: it accumulates. The result is gain inflated by 50 to 200 percent over reality.
This is exactly what happened on the first cycling GPS units of the 2000s. A climb really worth 600 m would display 1 100 m. Forums were full of people comparing their tracks and unable to reproduce the same number — that was the noise speaking, not the mountain.
IV.The fix: stop listening to whispers
The solution is elegant, and it fits in one sentence: only count an elevation change if it crosses a certain threshold. As long as the movement stays below that threshold, we treat it as noise and throw it away. For a « real » climb to register, the watch has to see a clear, decisive change — not a half-metre flicker.
GPXchunk uses a 1-metre threshold. That's the value serious sports tools have converged on over the last decade or so for barometric tracks. Set it too low (half a metre), too much noise leaks through and gain stays inflated. Set it too high (five metres), you miss the genuine rolls of an undulating trail and gain is underestimated. One metre is the trade-off that best matches the trail underfoot: you stop measuring the electronics jitter, and you start measuring the path. The filtered D+ is one of the twelve measures that come out of a GPX track; the other eleven deserve the same careful reading.
V.Why Strava, Garmin and the rest disagree
With what we've just covered, the gap between tools is almost entirely explained. Three choices stack up.
- The elevation source isn't the same. Strava often replaces the recorded elevation with elevation from a topographic map. Garmin Connect keeps the barometric elevation from your watch. On a long outing, those two sources can differ by 50 to 100 metres before any filter is even applied.
- Some tools smooth the track before computing. They take an average over five or ten consecutive points before looking at variations. This crushes the noise even further — but it also crushes genuine rapid changes, like a step on a trail or a short pitch in gradient. GPXchunk does not smooth: the track you read is exactly the one in your file.
- The threshold value differs between vendors. One metre, one and a half, two: each one defends its own number, and sometimes changes it without an announcement. Garmin users remember the day their historical D+ « shifted » by a few percent overnight after a firmware update.
No method is the truth. They are all honest estimates of the same phenomenon. But if you always compare with the same tool, your numbers stay consistent with each other — and that's what matters for tracking progress from one season to the next.
VI.When the measurement breaks down
There are a handful of situations where, no matter the tool, elevation gain stops meaning anything. Worth knowing before you compare too seriously:
- Tunnels. The GPS loses signal, elevation snaps to zero or interpolates in a straight line. Depending on what your watch does, you may see a phantom negative gain or nothing at all. No calculation will save this — it's the recorder's job to handle the gap.
- Cable cars, chairlifts, ski lifts. If your watch lacks an « altitude auto-pause » setting, the eight hundred metres gained in the cabin add to D+ as if you had climbed them on foot. On a ski-touring day with several lifts, the figure can triple.
- Long pauses. Three minutes standing still is about a hundred and fifty recorded points. If the barometer drifts by a metre during that interval, you gain a metre of D+ « for free ». On a long hike with ten breaks, it adds up.
- Pure GPS tracks. On a phone, without a barometer, elevation is noisy. The 1-metre threshold lets some noise through anyway. If you take your training even a little seriously, a barometric watch changes everything.
VII.Seeing it in practice on GPXchunk
This is exactly where segment-by-segment analysis pays off. On a forty-kilometre outing with a long climb at km 24–28, the total gain blends that climb, undulating cruising before and after, and three hours of accumulated noise. The segment gain isolates the variation you actually want to read — usually the one you actually care about. Gain is just one of the twelve numbers recomputed for that segment alone.
Three clicks: load your file (nothing leaves your browser), drop the handles on the elevation profile at the start and end of the climb, read the segment gain. Then compare with what Strava or Garmin show for that same climb. Most of the time, the gap is small. When it's large, it's almost always because you weren't comparing exactly the same stretch of track.