Skip to content

spatial-monorepo


spatial-monorepo / wayfinding/src / detectFloorTransitions

Function: detectFloorTransitions()

detectFloorTransitions(route, graph): FloorTransition[]

Defined in: packages/wayfinding/src/transitions.ts:40

Detect floor transitions in a route by comparing consecutive leg levelIds.

For each pair of adjacent legs where the floor changes:

  • The transition coordinate is the last point of the departing leg.
  • The category is read from the departing leg's own floorChange.via instruction when present (grid engine); otherwise it falls back to the nearest graph node within VERTICAL_NODE_SEARCH_RADIUS_M of the transition coordinate (legacy engine, whose leg endpoint IS the node coordinate).
  • If neither source resolves a category, it defaults to 'elevator'.

Parameters

route

Route

graph

WayfindingGraph

Returns

FloorTransition[]

Released under commercial licensing.