navi/backend/services/navi_offroute
Matt 53ffba5795 MVUM Layer 1: per-edge annotation + accurate closure counts
Annotate each network-leg segment with its MVUM access status for the selected mode,
using the Layer-0 MVUMSpatialIndex. No routing-decision or Valhalla changes.

- mvum_annotate.py (new): annotate_network_edges(coords,(lat,lon)), mode, spatial_index,
  on_date) -> [EdgeAnnotation{coord_pair_index, matched_features, mvum_status}]. Walks
  consecutive pairs, queries the index (10m buffer), applies a parallelism filter (acute
  angle to the edge <=45deg, both directions), resolves per-mode access via the existing
  check_access/get_mode_field/symbol_to_access (worst/most-restrictive across matches).
  Mode map: foot->open (skip), 2w->e_bike_class1, 4w->atv, vehicle->highclearancevehicle;
  auto is already resolved to a concrete candidate upstream.
- router.py: _route_D_network_only and _build_response annotate the network leg using the
  injected self.spatial_index (getattr-guarded; skipped + debug-logged if None), attach
  edge_mvum to the network feature, and add summary.mvum_closed_crossings +
  summary.mvum_segments_annotated.
- offroute_route.py: inject app.config[MVUM_SPATIAL_INDEX] onto the router per request.
- DirectionsPanel.jsx: warning row when mvum_closed_crossings>0.
- tests/test_mvum_annotate.py: parallel match, perpendicular reject, seasonal closure,
  symbol fallback, summary count.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 01:18:03 +00:00
..
tests MVUM Layer 1: per-edge annotation + accurate closure counts 2026-05-26 01:18:03 +00:00
__init__.py Add navi-offroute service (extraction #8 — final) (#10) 2026-05-22 23:30:43 -06:00
admin.py MVUM Layer 0: spatial index foundation (#22) 2026-05-25 18:53:58 -06:00
app.py MVUM Layer 0: spatial index foundation (#22) 2026-05-25 18:53:58 -06:00
astar.py fix(offroute): smooth max_grade penalty instead of hard cliff (DEM noise robustness) 2026-05-25 15:34:18 +00:00
barriers.py Add navi-offroute service (extraction #8 — final) (#10) 2026-05-22 23:30:43 -06:00
cost.py Rename mode constants: mtb→2w, atv→4w (#20) 2026-05-25 15:33:47 -06:00
friction.py Add navi-offroute service (extraction #8 — final) (#10) 2026-05-22 23:30:43 -06:00
mvum.py MVUM Layer 0: spatial index foundation (#22) 2026-05-25 18:53:58 -06:00
mvum_annotate.py MVUM Layer 1: per-edge annotation + accurate closure counts 2026-05-26 01:18:03 +00:00
offroute_route.py MVUM Layer 1: per-edge annotation + accurate closure counts 2026-05-26 01:18:03 +00:00
router.py MVUM Layer 1: per-edge annotation + accurate closure counts 2026-05-26 01:18:03 +00:00
trails.py Add navi-offroute service (extraction #8 — final) (#10) 2026-05-22 23:30:43 -06:00