Outdoor Route
"/home/yossef/notes/git/projects/maplibra/flows/Outdoor Route.md"
path: maplibra/flows/Outdoor Route.md
- **fileName**: Outdoor Route
- **Created on**: 2026-06-16 00:48:42
Outdoor Route
Purpose: How indoor and outdoor routes are stitched together for campus-scale navigation.
Related: ../Home.md, ../Architecture.md, ../modules/Outdoor Routing.md, ../modules/Pathfinding.md, ../modules/Path Renderer.md
Route Stitching Flow
1. Detect Outdoor Points
PathfindingController.computeRoute(start, target)
→ isOutdoorLocation(start) — outside building footprint?
→ isOutdoorLocation(target) — outside building footprint?
2. Determine Route Type
| Start | Target | Strategy |
|---|---|---|
| Indoor | Indoor | Pure indoor A* |
| Outdoor | Outdoor | Outdoor street route only (if direct) |
| Outdoor | Indoor | Stitch outdoor → indoor entrance |
| Indoor | Outdoor | Stitch indoor entrance → outdoor |
3. Find Entrance/Exit Points
- Get building footprint (largest floor polygon)
- Find nearest entrance node(s) on building boundary
- Primary/secondary entrance preference based on config
4. Outdoor Segment
getNearestRoad(outdoorPoint) → nearest road point
getOutdoorRouteData(roadPointA, roadPointB) → street route coords
- Caches results with provider-specific keys
- Timeout:
routeTimeoutMs(default 3500ms) - Fallback: direct route solver around building footprint
5. Unified Graph
unifiedGraph = indoorGraph + outdoorSegmentNodes
→ add temporary nodes for outdoor points
→ add edges connecting outdoor → entrance → indoor
→ run A* on unified graph
6. Smoothing
- Indoor segments: standard route smoothing (walkability checks, shortcuts, Bezier curves)
- Outdoor segments: simplified or straight-line
- Stitch points: entrance nodes where indoor meets outdoor
7. Rendering
PathRenderercreates separate line features for indoor and outdoor segments- Indoor segments filtered by
floorId - Outdoor segments shown on all floors (or a dedicated outdoor floor)
unifiedOutdoorFloorId='outdoor'
Important Files
src/outdoor/outdoor-routing.js— Main outdoor routing mixinsrc/outdoor/outdoor-router.js— API calls for nearest road and street routesrc/pathfinding/unified-graph.js— Combined indoor + outdoor graphsrc/pathfinding/campus-routing.js— Campus-scale multi-building routingsrc/pathfinding/outdoor-loading-ui.js— Loading overlay for outdoor API calls
How It Connects
-
Outdoor routing is a mixin on
PathfindingController -
RoutingControllercalls outdoor methods when route points are outside -
outdoor-router.jsmakes external API calls (network required) -
Results are cached in
PathfindingController.outdoorCache -
The unified graph is temporary; it is not persisted
-
PathRendererrenders both indoor and outdoor segments with different stylingcontinue:[[]]
before:[[]]