Skip to content

spatial-monorepo


spatial-monorepo / wayfinding/src / deriveGridResolution

Function: deriveGridResolution()

deriveGridResolution(bboxWidthM, bboxHeightM, requestedCellsPerMetre?, memoryBudgetCells?): GridResolution

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

Picks the grid resolution and dimensions for a floor bounding box, auto-derating (5 → 4 → 3 cells/metre by default) when the requested resolution would exceed the memory budget.

Grid size scales with the floor's bounding box rather than a fixed buffer — unlike the HEB reference's fixed 1024² buffer (which caps floor size at ~200 m and logs "contact support" beyond it, per the Wayfinding v2 plan §2.2) — so large venues degrade to a coarser resolution instead of hitting a hard wall. Derating stops at MIN_CELLS_PER_METRE; a venue too large even at that floor is built anyway (best effort) with derated: true.

Parameters

bboxWidthM

number

bboxHeightM

number

requestedCellsPerMetre?

number = DEFAULT_CELLS_PER_METRE

memoryBudgetCells?

number = DEFAULT_MEMORY_BUDGET_CELLS

Returns

GridResolution

Released under commercial licensing.