pub fn estimate_headings_from_neighbors(
positions: &[&GnssPosition],
) -> Vec<Option<f64>>Expand description
Estimate headings from neighboring GNSS positions.
For each interior position x, computes the haversine bearing from position
x-1 to x+1. The estimate is discarded when:
xis the first or last position (no symmetric neighbors),- the distances
x-1 → xandx → x+1differ by ≥ 20% of the larger, - the backward bearing (
x-1→x) and forward bearing (x→x+1) diverge by ≥ 5° (lateral-jump / junction guard), - consecutive estimated headings change by ≥ 5° (continuity check).
Returns a Vec with the same length as positions; entries that fail any
guard are None.