Skip to main content

Module spatial

Module spatial 

Source
Expand description

Planar point-to-polyline snapping over a uniform grid index.

Edges arrive as flattened vertex arrays plus per-edge offsets (the R layer passes sf::st_coordinates() output). Coordinates are treated as planar; the R layer owns CRS semantics.

Structsยง

SegmentIndex
A uniform grid over the segments of a set of polylines, sized for about one segment per cell. Street-network segments are short relative to the extent, so each occupies a handful of cells; the few that span many cells go into an oversize list scanned on every query.
Snap
The nearest location on the edge set to a query point.