spatial-monorepo / wayfinding/src / computeFloorCentroid
Function: computeFloorCentroid()
computeFloorCentroid(
points):Position2D
Defined in: packages/wayfinding/src/grid-projector.ts:27
Bounding-box centroid of a set of [lng, lat] points.
Used as the equirectangular projection origin ("per-level local metric coordinate frame ... about the floor centroid" per the Wayfinding v2 plan §3.2). The bbox centre — rather than e.g. an area-weighted polygon centroid — minimises the worst-case projection distortion across the floor's extremes, which is what keeps grid dimensions symmetric around the origin.
Parameters
points
readonly Position2D[]
