trails/packages/gpx/src
Ullrich Schäfer 29be9cbe5f
feat(gpx): apply elevation cleaning to totals + profile chart
Task group 2 (part a) of elevation-profile-hardening — wire the group-1
primitives into the headline stat and the chart.

- computeElevation (parse.ts): despike each segment's elevation sequence,
  then take filteredTotals; gain/loss are now noise-filtered (no more
  20–50% inflation from per-point jitter), the profile is built from the
  despiked data, and additive gainRaw/lossRaw expose the unfiltered sums.
- elevationSeries: despike per segment (no cross-trkseg interpolation)
  before downsampling, so the chart and the headline totals derive from
  the same cleaned data.
- types.ts: GpxData.elevation gains gainRaw/lossRaw (additive).

Well-formed monotonic climbs are unchanged (steps exceed the 5 m
threshold → filtered == raw); a shared noisy-track test proves jitter is
filtered and a 300 m single-point spike is interpolated out of both the
totals and the chart.

Verified: gpx 111/111; full pnpm typecheck 13/13, lint 13/13, test 11/11
(journal + planner compile with the additive fields).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-14 00:56:36 +02:00
..
compute-days.test.ts Add unit tests for computeDays and GPX overnight roundtrip 2026-04-11 00:05:54 +02:00
compute-days.ts Add multi-day data model, computeDays, and GPX roundtrip 2026-04-10 23:51:31 +02:00
daybreaks-extraction.test.ts Add per-day map coloring and remaining unit tests 2026-04-11 00:12:27 +02:00
elevation-clean.test.ts feat(gpx): elevation cleaning primitives (despike + hysteresis totals) 2026-07-14 00:46:13 +02:00
elevation-clean.ts feat(gpx): elevation cleaning primitives (despike + hysteresis totals) 2026-07-14 00:46:13 +02:00
elevation-series.test.ts feat(gpx): apply elevation cleaning to totals + profile chart 2026-07-14 00:56:36 +02:00
elevation-series.ts feat(gpx): apply elevation cleaning to totals + profile chart 2026-07-14 00:56:36 +02:00
generate.test.ts Add per-waypoint notes and nearby POI snap to Planner 2026-05-17 23:58:21 +02:00
generate.ts Add per-waypoint notes and nearby POI snap to Planner 2026-05-17 23:58:21 +02:00
geom.test.ts feat(gpx): lenient point parsing + route (<rte>) support 2026-07-14 00:06:35 +02:00
index.ts journal-elevation-profile: elevation chart + map↔chart sync 2026-06-12 15:34:45 +02:00
moving-time.test.ts activity-stats: shared StatRow + canonical metrics across surfaces 2026-06-12 14:48:36 +02:00
moving-time.ts activity-stats: shared StatRow + canonical metrics across surfaces 2026-06-12 14:48:36 +02:00
nogo.test.ts Add unit tests for no-go area round-trip and waypoint extraction 2026-04-03 12:50:57 +01:00
parse-node.test.ts test(gpx): fixture corpus + verification (groups 5–6) 2026-07-14 00:30:46 +02:00
parse.test.ts feat(gpx): apply elevation cleaning to totals + profile chart 2026-07-14 00:56:36 +02:00
parse.ts feat(gpx): apply elevation cleaning to totals + profile chart 2026-07-14 00:56:36 +02:00
timestamp-repair.test.ts feat(gpx): post-parse timestamp repair 2026-07-14 00:10:57 +02:00
timestamp-repair.ts feat(gpx): post-parse timestamp repair 2026-07-14 00:10:57 +02:00
types.ts feat(gpx): apply elevation cleaning to totals + profile chart 2026-07-14 00:56:36 +02:00
waypoints.ts Include waypoint note in GPX export and extractWaypoints type 2026-05-18 07:38:55 +02:00