Skip to main content

geo

Classes

Enumerations


NFZType

Type of no-fly zone.

Functions


haversine_distance_meters

inline
Calculate Haversine distance between two geographic points. Computes the great-circle distance between two points on Earth’s surface using the Haversine formula. This provides accurate results for most navigation purposes, though for survey-grade precision consider Vincenty’s formulae.

Parameters

  • p1 First geographic point
  • p2 Second geographic point

Returns

Distance in meters between the two points Returns 0.0 if both points are identical Returns approximately 20,000,000 meters for antipodal points :::note Uses Earth radius of 6,371,000 meters (mean radius) ::: :::note Accuracy degrades for very large distances due to Earth’s ellipsoidal shape :::

Example:


is_point_in_polygon

inline
Check if a point is inside a polygon using ray casting. Uses the even-odd rule (ray casting algorithm).

Parameters

  • point The point to check
  • vertices Polygon vertices

Returns

true if point is inside the polygon

segment_intersects_polygon

inline
Check if a line segment intersects a polygon (bounding box check) This is a simplified check using bounding boxes. For more accurate results, consider great circle paths.

Parameters

  • segment The line segment
  • polygon The polygon vertices

Returns

true if segment might intersect polygon

path_intersects_nfz

inline
Check if a flight path (waypoint to waypoint) intersects any NFZ.

Parameters

  • from Starting point
  • to Ending point
  • nfz_list List of no-fly zones to check against

Returns

Pointer to the NFZ that the path intersects, or nullopt if clear

path_intersects_nfz

inline
Check if any point in a path intersects NFZ.

Parameters

  • waypoints List of waypoints defining the path
  • nfz_list List of no-fly zones

Returns

Pointer to first intersecting NFZ, or nullopt if clear

Variables


kPi