Constructs an undirected adjacency matrix `A` where segments are neighbors if they share a node (endpoint). Intended to be used after `roads_to_segments()`.
build_adjacency(segments, crs_m = 3857, tol = 0, verbose = FALSE)A list with:
Sparse symmetric adjacency matrix (`dgCMatrix`).
Integer vector component id (length n). Isolates are their own components.
Logical vector (length n).
An `sf` with LINESTRING geometries and (optionally) `seg_id`.
Metric CRS used when `segments` is lon/lat (for robust node keys). Default 3857.
Nonnegative numeric tolerance for snapping node coordinates (in meters if projected). If 0, uses exact coordinates. Default 0.
Logical; emit simple messages. Default FALSE.
Isolates (degree 0) are kept (all-zero rows/cols). Connected components are returned for ICAR sum-to-zero centering per component.