GPX share-sheet import intent, parser and simplification #24

Closed
opened 2026-08-31 17:14:43 +02:00 by robert · 1 comment
robert commented 2026-08-31 17:14:43 +02:00 (Migrated from git.butzei.de)

Goal

Get routes onto the phone in two taps from komoot, or from any other planner.

Acceptance criteria

  • Intent filter for ACTION_SEND and ACTION_VIEW on application/gpx+xml and */*.gpx
  • komoot: tour -> share -> Export as GPX -> PedalPebble works end to end
  • GPX track points parsed, including elevation; routes and tracks both handled
  • Polyline simplified to roughly 5 m spacing, preserving corners
  • Malformed or empty GPX rejected with a clear message
  • Verified with exports from komoot and at least one other planner

Files

  • companion/.../route/import/GpxImporter.kt

Notes

komoot GPX carries geometry only - no turn instructions. That is what the enrichment issues solve.

Update — 2026-09-01: parser edge cases

"Parse track points" left the awkward half of real GPX files undefined. Route sources differ more than
the plan assumed — which is the same observation that produced the tier-0 enricher in #63.

  • <rte>/<rtept> routes handled as well as <trk>/<trkpt> tracks — bikerouter.de and
    RideWithGPS both emit routes, not only tracks
  • Multiple <trkseg> segments joined, with the seam not treated as a turn
  • Multiple <trk> elements in one file: handled or rejected with a clear message, not silently
    truncated to the first
  • Missing <ele> tolerated — the elevation profile in #25 degrades, the import does not fail
  • Missing or duplicate timestamps tolerated; an imported route needs geometry, not time
  • Waypoints preserved rather than discarded, for #63 and FR-N12
  • Malformed XML and empty tracks rejected with a message naming the problem
  • Fixture files covering each of the above, alongside #38
## Goal Get routes onto the phone in two taps from komoot, or from any other planner. ## Acceptance criteria - [ ] Intent filter for `ACTION_SEND` and `ACTION_VIEW` on `application/gpx+xml` and `*/*.gpx` - [ ] komoot: tour -> share -> Export as GPX -> PedalPebble works end to end - [ ] GPX track points parsed, including elevation; routes and tracks both handled - [ ] Polyline simplified to roughly 5 m spacing, preserving corners - [ ] Malformed or empty GPX rejected with a clear message - [ ] Verified with exports from komoot and at least one other planner ## Files - `companion/.../route/import/GpxImporter.kt` ## Notes komoot GPX carries geometry only - no turn instructions. That is what the enrichment issues solve. ## Update — 2026-09-01: parser edge cases "Parse track points" left the awkward half of real GPX files undefined. Route sources differ more than the plan assumed — which is the same observation that produced the tier-0 enricher in #63. - [ ] **`<rte>`/`<rtept>` routes handled as well as `<trk>`/`<trkpt>` tracks** — bikerouter.de and RideWithGPS both emit routes, not only tracks - [ ] Multiple `<trkseg>` segments joined, with the seam not treated as a turn - [ ] Multiple `<trk>` elements in one file: handled or rejected with a clear message, not silently truncated to the first - [ ] Missing `<ele>` tolerated — the elevation profile in #25 degrades, the import does not fail - [ ] Missing or duplicate timestamps tolerated; an imported route needs geometry, not time - [ ] Waypoints preserved rather than discarded, for #63 and FR-N12 - [ ] Malformed XML and empty tracks rejected with a message naming the problem - [ ] Fixture files covering each of the above, alongside #38
Owner

Closed by PR #78 (merged): hardened SAX parser (trk+rte, multi-trkseg join, missing ele/time tolerated, multi-track rejection, XXE/size/depth/point caps), RDP simplification at 5m, and the share-sheet ACTION_SEND/ACTION_VIEW intent filters. Not yet verified against a real device or live komoot/bikerouter.de/RideWithGPS exports — that needs Robert's phone, tracked as a follow-up rather than blocking this issue further.

Closed by PR #78 (merged): hardened SAX parser (trk+rte, multi-trkseg join, missing ele/time tolerated, multi-track rejection, XXE/size/depth/point caps), RDP simplification at 5m, and the share-sheet ACTION_SEND/ACTION_VIEW intent filters. Not yet verified against a real device or live komoot/bikerouter.de/RideWithGPS exports — that needs Robert's phone, tracked as a follow-up rather than blocking this issue further.
Sign in to join this conversation.
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
robert/PedalPebble#24
No description provided.