recon/lib/offroute
Matt 58347415bc offroute: bidirectional wilderness routing (all 4 scenarios)
Support all four routing scenarios:
  A: off-network → on-network (wilderness then Valhalla)
  B: off-network → off-network (wilderness, Valhalla, wilderness)
  C: on-network → off-network (Valhalla then wilderness)
  D: on-network → on-network (pure Valhalla passthrough)

Off-network detection via Valhalla /locate endpoint:
  - Snap distance > 500m = off-network

Key implementation details:
  - _locate_on_network() helper for network detection
  - route() dispatches to scenario-specific handlers
  - _pathfind_wilderness() extracted for reuse (runs MCP)
  - _valhalla_route() helper for network segments
  - _build_response() unifies GeoJSON output format

Memory management:
  - Sequential MCP runs for scenario B (not parallel)
  - gc.collect() after each MCP run
  - Bbox centered on wilderness origin, not distant destination

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-08 21:11:53 +00:00
..
__init__.py feat(offroute): Phase O1 foundation — PMTiles decoder, Tobler cost, MCP pathfinder prototype 2026-05-07 23:43:56 +00:00
barriers.py feat(offroute): Phase O4 — multi-mode cost functions (foot/mtb/atv/vehicle) 2026-05-08 14:11:56 +00:00
cost.py feat(offroute): MVUM legal access — pathfinder integration + places panel API + boundary_mode control 2026-05-08 14:26:18 +00:00
dem.py feat(offroute): Phase O1 foundation — PMTiles decoder, Tobler cost, MCP pathfinder prototype 2026-05-07 23:43:56 +00:00
friction.py feat(offroute): Phase O2b — WorldCover friction integration, lake avoidance validated 2026-05-08 06:33:45 +00:00
mvum.py feat(offroute): MVUM legal access — pathfinder integration + places panel API + boundary_mode control 2026-05-08 14:26:18 +00:00
prototype.py feat(offroute): Phase O3a — trail burn-in, pathfinder seeks trail corridors 2026-05-08 07:26:25 +00:00
router.py offroute: bidirectional wilderness routing (all 4 scenarios) 2026-05-08 21:11:53 +00:00
trails.py feat(offroute): Phase O3a — trail burn-in, pathfinder seeks trail corridors 2026-05-08 07:26:25 +00:00