Large Room Strict Exit Heuristic

"/home/yossef/notes/git/projects/maplibra/decisions/Large Room Strict Exit Heuristic.md"

path: maplibra/decisions/Large Room Strict Exit Heuristic.md

- **fileName**: Large Room Strict Exit Heuristic
- **Created on**: 2026-06-16 00:48:42

Large Room Strict Exit Heuristic

Purpose: Record why strict room-exit snapping is disabled for very large room polygons.

This decision is documented in ../modules/Snapping.md under Room Exit Behavior and Known Tradeoff.

Context

Dropped indoor start points are created in src/pathfinding/drop-ui.js with strictRoomExit so routes from real enclosed rooms prefer exiting through doors.

Open public areas can also appear as room polygons in MVF data. When a dropped pin lands in a main loop or concourse, treating that polygon as a strict room forces snapping to a door even though the user is already in walkable public space.

Decision

src/pathfinding/snapping.js now computes the containing room polygon area before enforcing strictRoomExit.

If the room area is above maxStrictRoomArea, strict door-only snapping is disabled and normal candidate ranking can include nearby walkable nodes. The default cutoff is 300m².

Small enclosed rooms still enforce strict exit behavior and pass allowTrim: true to getDoorSnapCandidates().

Tradeoff

Area alone is a heuristic. A large enclosed room over the cutoff can be treated like an open public area. A more precise future fix would use room metadata or walkable-area context to distinguish public concourses from large enclosed destinations.

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