trails/packages
Ullrich Schäfer 99278fd305
feat(gpx): lenient point parsing + route (<rte>) support
Task groups 1–2 of gpx-parser-robustness. The parser trusted its input:
`parseFloat(attr ?? "0")` turned a missing lat/lon into a 0,0 Null Island
point (which passes range validation) and garbage into NaN that poisoned
distance and gain/loss totals; `<rte>`/`rtept` files (Garmin courses, many
exporters) parsed to zero track points and were rejected.

- `parsePoint`: skip a trkpt/rtept whose lat/lon is missing or non-finite
  (no more 0,0 default); a non-finite `<ele>` becomes `undefined` so it
  never leaks NaN into totals. Parsing stays parseFloat-lenient (trailing
  junk like `471.0m` still accepted), gated by Number.isFinite.
- Drop segments left with fewer than 2 points (render nothing / break
  distance math).
- Parse `<rte>` as track segments appended after `<trk>` segments, rtept
  handled identically — route-only files now import.

No GpxData shape change; well-formed files parse identically. Updated the
geom single-point test to the new drop-invariant.

Verified: gpx typecheck + lint clean, 76/76 tests pass, journal + planner
typecheck unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-14 00:06:35 +02:00
..
api route-surface-breakdown (Phase 1): Planner-path surface/waytype bars 2026-06-14 18:46:49 +02:00
db feat(journal): federation instance blocklist 2026-07-13 22:59:11 +02:00
fit build(deps): bump the production group with 18 updates 2026-06-21 08:32:18 +00:00
gpx feat(gpx): lenient point parsing + route (<rte>) support 2026-07-14 00:06:35 +02:00
i18n route-surface-breakdown (Phase 1): Planner-path surface/waytype bars 2026-06-14 18:46:49 +02:00
jobs build(deps): bump the production group across 1 directory with 35 updates 2026-07-13 09:29:56 +02:00
map-core poi-index: Grafana dashboard/alert, docs, privacy manifest 2026-07-12 22:54:51 +02:00
sentry-config Fix sentry-config typecheck: explicit types: [node] in tsconfig 2026-04-18 00:43:48 +02:00
types one source of truth for Route/Activity shapes; enforce api contracts 2026-06-10 07:39:50 +02:00