Skip to content

spatial-monorepo


spatial-monorepo / wayfinding/src / detectFloorTransitions

Function: detectFloorTransitions()

detectFloorTransitions(route, graph): FloorTransition[]

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

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 determined by looking up the graph node whose coordinates match the transition coordinate and inspecting its category field.
  • If no matching node is found, category defaults to 'elevator'.

Parameters

route

Route

graph

WayfindingGraph

Returns

FloorTransition[]

Released under commercial licensing.