Skip to main content

calculate_heading_at_point

Function calculate_heading_at_point 

Source
pub fn calculate_heading_at_point(
    point: &Point<f64>,
    linestring: &LineString<f64>,
) -> Result<f64, ProjectionError>
Expand description

Calculate heading at a projected point on a linestring

Returns the direction (bearing) of the linestring at the given point. This is used to compare with GNSS heading to filter incompatible candidates.

§Arguments

  • point - The point on the linestring
  • linestring - The linestring

§Returns

Heading in degrees (0-360), where:

  • 0° = North
  • 90° = East
  • 180° = South
  • 270° = West