geo
Classes
| Name | Description |
|---|---|
GeoPoint | Geographic point with latitude, longitude, and altitude. |
GeoSegment | Line segment in geographic coordinates. |
NoFlyZone | No-Fly Zone polygon definition. |
Enumerations
| Name | Description |
|---|---|
NFZType | Type of no-fly zone. |
NFZType
| Value | Description |
|---|---|
AIRPORT | FAA restricted airspace around airports. |
TEMPORARY | Temporary flight restrictions (TFR) |
MILITARY | Military restricted zones. |
NATIONAL_PARK | National park no-drone zones. |
PRISON | Correctional facility airspace. |
HOSPITAL | Hospital/helipad emergency zones. |
CUSTOM | Custom user-defined zone. |
Functions
| Return | Name | Description |
|---|---|---|
double | haversine_distance_meters | Calculate Haversine distance between two geographic points. |
bool | is_point_in_polygon | Check if a point is inside a polygon using ray casting. |
bool | segment_intersects_polygon | Check if a line segment intersects a polygon (bounding box check) |
std::optional< std::reference_wrapper< const NoFlyZone > > | path_intersects_nfz | Check if a flight path (waypoint to waypoint) intersects any NFZ. |
std::optional< std::reference_wrapper< const NoFlyZone > > | path_intersects_nfz | Check if any point in a path intersects NFZ. |
haversine_distance_meters
inline
Parameters
-
p1First geographic point -
p2Second 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
Parameters
-
pointThe point to check -
verticesPolygon vertices
Returns
true if point is inside the polygonsegment_intersects_polygon
inline
Parameters
-
segmentThe line segment -
polygonThe polygon vertices
Returns
true if segment might intersect polygonpath_intersects_nfz
inline
Parameters
-
fromStarting point -
toEnding point -
nfz_listList of no-fly zones to check against
Returns
Pointer to the NFZ that the path intersects, or nullopt if clearpath_intersects_nfz
inline
Parameters
-
waypointsList of waypoints defining the path -
nfz_listList of no-fly zones
Returns
Pointer to first intersecting NFZ, or nullopt if clearVariables
| Return | Name | Description |
|---|---|---|
constexpr double | kPi |