Route Computation

"/home/yossef/notes/git/projects/maplibra/flows/Route Computation.md"

path: maplibra/flows/Route Computation.md

- **fileName**: Route Computation
- **Created on**: 2026-06-16 00:48:42

Route Computation

Purpose: How a user route becomes rendered route features.

Related: ../Home.md, ../modules/Pathfinding.md, ../modules/Route Smoothing.md, ../modules/Snapping.md

Flow

  1. User selects or drops route endpoints.
  2. src/pathfinding/snapping.js produces start and target snap candidates.
  3. src/pathfinding/route-compute.js selects the best candidate pair and runs A*.
  4. A* returns ordered graph node IDs.
  5. src/pathfinding/route-features.js converts node IDs to per-floor LineString features.
  6. ../modules/Route Smoothing.md runs validated straightening, simplification, shortcutting, curves, and human smoothing.
  7. src/path-renderer.js and src/path-renderer/* render the route line and connector markers.

Route Shape Cleanup

The route feature stage now starts with straightenWalkableStaircase() for shallow grid staircases, then straightenCorridorZigzag() for sharper clusters. Both are guarded by walkability checks.

Dropped Indoor Starts

src/pathfinding/drop-ui.js marks dropped indoor starts with strictRoomExit. During snapping, src/pathfinding/snapping.js keeps that behavior for small enclosed rooms, but disables the strict door-only path for room polygons larger than the configured strict-room area cutoff. This prevents large open indoor areas from routing to an unnecessary door before A* runs.

continue:[[]]
before:[[]]