Skip to content

spatial-monorepo


spatial-monorepo / wayfinding/src / buildBaseOccupancyGrid

Function: buildBaseOccupancyGrid()

buildBaseOccupancyGrid(units, openings, opts?): BaseOccupancyGrid

Defined in: packages/wayfinding/src/occupancy-grid.ts:361

Rasterizes the level-static portion of the grid — walls, opening gaps, and fixture/kiosk obstacles (steps 1-3 and 5 of buildOccupancyGrid's doc comment) — deliberately excluding the two rung-specific dynamic layers (wall-vertex clearance discs and the blocked-unit fill, steps 4 and 6). Those are applied per relaxation rung by restampOccupancyGrid instead, so that the (comparatively expensive) wall/opening/fixture rasterization runs once per level per IMDF version rather than once per ladder rung and once per route call (issue #483; see getBaseOccupancyGridForLevel in grid-relaxation.ts for the cache built on top of this).

Returns a BaseOccupancyGrid: an OccupancyGrid plus the cell-space ring and door-gap geometry restampOccupancyGrid needs, so it never has to re-derive that geometry from lng/lat.

Parameters

units

IMDFFeature`<UnitProps>`[]

openings

IMDFFeature`<OpeningProps>`[]

opts?

OccupancyGridOptions = {}

Returns

BaseOccupancyGrid

Released under commercial licensing.