navi/frontend
malice 5ba9527c02
MVUM Layer 3a: multi-modal Auto via MVUM trailhead transitions (#26)
Auto now also considers "drive in to a trailhead, switch vehicles, continue
on foot/2w/4w" trips and picks one when it is meaningfully faster than the
single-mode winner. Implicit — no new chip; Auto just returns the fastest plan.

Backend:
- mvum_transitions.py: TrailheadIndex (STRtree over trail_entry_points), built
  once per process via load_trailheads() (mirrors the MVUMSpatialIndex singleton).
  query_trailheads_near_line(coords, buffer_m=2000) with a precise distance filter.
- router.py: _route_auto, after the single-mode probe and only when the winner is
  ok AND total_distance_km >= MIN_HYBRID_DISTANCE_KM (8.0), tries hybrids. For each
  candidate trailhead near the winning polyline (closest first, capped at 20) and
  each (drive, offroad) pair in HYBRID_PAIRS, it routes both legs (annotate_mvum
  off) and sums leg times with NO transition cost. A hybrid wins only if it beats
  the single-mode winner by >= HYBRID_MIN_TIME_SAVINGS_MIN (15 min); trivial
  offroad detours (< HYBRID_MIN_OFFROAD_KM = 0.8 km) are skipped. The winner is
  combined into a new "multi" scenario: leg1 features + a kind=transition marker
  + leg2 features; summary carries total_*, per-leg legs[], summed MVUM counts;
  selected_mode="hybrid". Each leg is annotated separately.
- app.py / offroute_route.py: load + inject the trailhead index singleton.

Frontend (additive — no api.js signature change):
- DirectionsPanel: per-leg breakdown row for hybrid/multi ("Drive X mi (Ymin)
  -> 4W X mi (Zmin) - total Wmin", lucide Repeat between legs); existing Auto
  badge still shows.
- MapView: network polylines colored by network_mode (vehicle/auto blue, 4w
  orange, 2w green, foot red); transition points rendered as a circle marker with
  the lucide Repeat icon + "Switch to <mode>" tooltip; bounds fit skips Points.

Tests: test_mvum_transitions.py — index load, near-line close-only query, short
trip stays single-mode, big-savings hybrid wins, trivial-detour + below-threshold
+ no-trailheads all fall back. 7 new tests; full offroute suite 71 passed.

Note: the DB column is trail_entry_points.highway_class; surfaced as record
"road_class" per the spec.

Co-authored-by: Matt <mj@k7zvx.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 22:49:13 -06:00
..
docs docs: add traffic-intelligent routing and Idaho 511 planned features 2026-05-08 07:02:00 +00:00
public feat: initial scaffold — Vite + React + Tailwind + MapLibre 2026-04-20 04:47:44 +00:00
src MVUM Layer 3a: multi-modal Auto via MVUM trailhead transitions (#26) 2026-05-25 22:49:13 -06:00
.gitignore chore: add *.bak* to .gitignore 2026-04-27 02:50:54 +00:00
deploy.sh feat: search, multi-stop routing, and route display 2026-04-20 16:50:53 +00:00
eslint.config.js feat: initial scaffold — Vite + React + Tailwind + MapLibre 2026-04-20 04:47:44 +00:00
index.html feat(navi): GPS origin + place detail panel + basic actions 2026-04-20 20:59:18 +00:00
LICENSE Initial commit 2026-04-20 06:42:56 +02:00
package-lock.json fix: contour overlay with pmtiles fork, absolute URL, extended zoom range 2026-05-07 03:58:46 +00:00
package.json fix: contour overlay with pmtiles fork, absolute URL, extended zoom range 2026-05-07 03:58:46 +00:00
postcss.config.js feat: initial scaffold — Vite + React + Tailwind + MapLibre 2026-04-20 04:47:44 +00:00
README.md Initial commit 2026-04-20 06:42:56 +02:00
vite.config.js feat: search, multi-stop routing, and route display 2026-04-20 16:50:53 +00:00

navi

Navi — self-hosted navigation web frontend for Echo6