Skip to content

Route finder: routing styles, loops, drag to edit, route breakdown - #87

Open
pepperstm wants to merge 3 commits into
mainfrom
feature/route-planner
Open

pepperstm wants to merge 3 commits into
mainfrom
feature/route-planner

Conversation

@pepperstm

@pepperstm pepperstm commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

A bigger route finder, inspired by the route planners in apps like Komoot and Calimoto. The features are our own take on ideas from them; none of their code, designs or services are used, and everything here is written from scratch on BRouter and OpenStreetMap.

What's new

  • Six routing styles: Road bike, Quiet roads, Gravel, Touring, Safest and Mountain bike. Each section between two waypoints can have its own style.
  • Easier editing: drag the route to add a waypoint between two others; Undo and Redo (⌘Z / ⇧⌘Z); Reverse, Close the loop, Out and back, Clear. Sections are planned one at a time and kept in memory, so moving a waypoint only re-plans the two sections next to it.
  • Make a loop: a round trip of a chosen distance and heading from the first waypoint (or the middle of the map), using BRouter's round-trip mode. It comes back as ordinary waypoints you can edit. Try another gives a different one.
  • Route breakdown: surfaces (paved, cobbles, gravel, dirt, not mapped) and road types (main roads, minor roads, cycle paths, tracks, paths) from the OSM way tags, with distances and shares. Point at one to show it on the map, or colour the route by either. Climbs are listed and shaded on the profile, and there's an estimated time at 75% of FTP from the app's own physics, including surface rolling resistance.

How

  • New core module crates/core/src/planner.rs: reading BRouter's GeoJSON with its way tags, joining sections, classifying ways, the breakdown, the map outline, ride time and loop waypoints.
  • geo::plan plans each section separately (four at once, cached); geo::round_trip makes the loop and seeds the cache so its waypoints plan back to exactly the same loop.
  • geo_plan now takes a style per section; new geo_round_trip command. Planned gains the climbs, section lengths, breakdown and time estimate.
  • New smoke option VP_SMOKE_PLAN (lat,lon;lat,lon;… or loop:lat,lon,km).

Also adds a roadmap item: a Road ride / Closed race choice per ride, with road rides on open roads that join the real road network.

Testing

  • npm run check passes: 8 new planner tests (154 in total).
  • The live-network tests pass: all eight famous climbs still plan, and a 40 km loop near Bovey Tracey came out at 38.7 km.
  • Smoke harness on Explore with a 40 km loop: 8 editable sections, 38.2 km, 5 climbs, about 1 h 36 min, 98% paved.
  • Not yet tried by hand: dragging the route to insert a waypoint, and the undo list.

Docs: docs/developers/routes.md (new "Planning on the map" section), connectors-and-services, architecture, building-and-testing, the wiki's Routes and the map page, README and HANDOFF.

- Six routing styles (road, quiet roads, gravel, touring, safest, MTB),
  chosen per section between waypoints.
- Sections are planned one at a time and kept in memory, so an edit only
  re-plans what changed.
- Drag the route to insert a waypoint; undo/redo, reverse, close the loop,
  out and back.
- Make a loop: BRouter round trips of a chosen distance and heading,
  returned as editable waypoints; "Try another" for a different one.
- Breakdown from the OSM way tags: surfaces and road types with distances,
  shown on the map; climbs listed and shaded on the profile; an estimated
  time at 75% of FTP from the app's own physics and surfaces.
- New core module planner.rs with 8 tests; a live-network loop test;
  VP_SMOKE_PLAN for the smoke harness. Docs and wiki page updated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant