#[non_exhaustive]pub enum Area {
BoundingBox {
south_west: GeoPoint,
north_east: GeoPoint,
},
PointRadius {
center: GeoPoint,
radius_nm: f64,
},
LocationRadius {
ident: String,
radius_nm: f64,
},
Polygon {
vertices: Vec<GeoPoint>,
},
}Expand description
The geographic area a briefing covers.
Not every source supports every shape natively; adapters either convert
(a point radius encloses a bounding box and vice versa) or return
crate::ProviderError::Unsupported.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
BoundingBox
Axis-aligned bounding box.
PointRadius
Circle of radius_nm nautical miles around a coordinate.
LocationRadius
Circle of radius_nm nautical miles around a published location
(ICAO/FAA aerodrome, navaid or fix identifier).
Polygon
A polygon over vertices, treated as an implicitly closed ring
(the last vertex connects back to the first). Vertex order may be
either winding; self-intersecting rings give ray-cast semantics.
Implementations§
Source§impl Area
impl Area
Sourcepub fn enclosing_bbox(&self) -> Option<(GeoPoint, GeoPoint)>
pub fn enclosing_bbox(&self) -> Option<(GeoPoint, GeoPoint)>
Smallest axis-aligned bounding box enclosing this area, as
(south_west, north_east), when one can be computed without a
location database.
Returns None for areas anchored to a published identifier; only
the provider can resolve those. The radius conversion uses the
small-area approximation (1 NM of latitude = 1/60 degree) and is
not meaningful within a radius of the poles.
Sourcepub fn contains(&self, point: GeoPoint) -> Option<bool>
pub fn contains(&self, point: GeoPoint) -> Option<bool>
Whether the area contains point, when that is decidable without a
location database: None for Area::LocationRadius (mirroring
the Self::enclosing_bbox contract), Some otherwise. This is
the spatial-association hook TFR/NOTAM/weather modules filter
geo-referenced products with.