Skip to content

spatial-monorepo


spatial-monorepo / wayfinding/src / findGridRoute

Function: findGridRoute()

findGridRoute(units, openings, origin, destination, opts?): GridRouteResult

Defined in: packages/wayfinding/src/grid-route.ts:48

Rasterizes units/openings (already filtered to one level) into an occupancy grid, then finds a route between two [lng, lat] points: Jump Point Search over the grid, string-pulled into a small number of straight, wall-respecting segments.

This is the first slice of the HEB-style grid routing engine (issue #472) — single floor, walls only. It is a standalone module, not wired into buildGraph / getDirections; see docs/plans/wayfinding-v2.md §3–4 for the phased plan that eventually flips the default engine.

Parameters

units

IMDFFeature`<UnitProps>`[]

openings

IMDFFeature`<OpeningProps>`[]

origin

Position2D

destination

Position2D

opts?

GridRouteOptions = {}

Returns

GridRouteResult

Released under commercial licensing.