spatial-monorepo / wayfinding/src / findPathNetworkRoute
Function: findPathNetworkRoute()
findPathNetworkRoute(
graph,origin,destination):PathNetworkRouteResult
Defined in: packages/wayfinding/src/path-network.ts:346
Routes origin -> destination over an authored path-network graph (issue #478): snaps both endpoints onto the nearest point of the network (turf nearestPointOnLine), splices each snap into a query-local working copy of the graph as a routable vertex (never mutating the cached graph itself — see spliceSnapPoint/addWorkingEdge), then runs Dijkstra from the origin's spliced vertex to the destination's. The returned coordinate path is [origin, ...network vertices..., destination] (deduped of near-zero-length segments at the ends, for the common case where an endpoint already sits exactly on the network).
A network with no path between the two resolved vertices — e.g. two disconnected sub-networks on the same level — returns { found: false, reason: 'no-path' }; per the Wayfinding v2 plan §3.9, this does NOT fall back to the grid engine (that decision is per-level, made by grid-multifloor.ts's routeLevelSegment before this function is ever called — a level with an authored network always routes over it).
