#[non_exhaustive]pub enum GridDefinition {
LatLon(LatLonGrid),
Mercator(MercatorGrid),
AlbersEqualArea(AlbersEqualAreaGrid),
LambertConformal(LambertConformalGrid),
PolarStereographic(PolarStereographicGrid),
Unsupported(u16),
}Expand description
Grid definition extracted from Section 3.
This enum is non-exhaustive because GRIB grid templates are open-ended: WMO can add standard templates and centers can use local templates. Prefer the query helpers on this type for common behavior, or keep a wildcard arm when matching specific grid families.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
LatLon(LatLonGrid)
Template 3.0: Regular latitude/longitude (equidistant cylindrical).
Mercator(MercatorGrid)
Template 3.10: Mercator.
AlbersEqualArea(AlbersEqualAreaGrid)
Template 3.31: Albers equal-area.
LambertConformal(LambertConformalGrid)
Template 3.30: Lambert conformal.
PolarStereographic(PolarStereographicGrid)
Template 3.20: Polar stereographic projection.
Unsupported(u16)
Unsupported template (stored for diagnostics).
Implementations§
Source§impl GridDefinition
impl GridDefinition
Sourcepub fn template_number(&self) -> u16
pub fn template_number(&self) -> u16
GRIB2 grid definition template number for typed templates.
Unsupported stores the unhandled template number from the source
message for diagnostics.
pub fn as_lat_lon(&self) -> Option<&LatLonGrid>
pub fn as_polar_stereographic(&self) -> Option<&PolarStereographicGrid>
pub fn as_mercator(&self) -> Option<&MercatorGrid>
pub fn as_lambert_conformal(&self) -> Option<&LambertConformalGrid>
pub fn as_albers_equal_area(&self) -> Option<&AlbersEqualAreaGrid>
pub fn unsupported_template(&self) -> Option<u16>
pub fn shape(&self) -> (usize, usize)
pub fn shape_num_points(&self) -> Result<usize, Error>
pub fn ndarray_shape(&self) -> Vec<usize>
pub fn num_points(&self) -> usize
pub fn checked_num_points(&self) -> Result<usize, Error>
pub fn declared_num_points(&self) -> Option<usize>
Sourcepub fn projected_x_coordinates(&self) -> Result<Option<Vec<f64>>, Error>
pub fn projected_x_coordinates(&self) -> Result<Option<Vec<f64>>, Error>
Projected x coordinates in metres relative to the first grid point.
Regular latitude/longitude grids return None; use
LatLonGrid::longitudes for those grids.
pub fn projected_x_coordinates_with_limit( &self, max_axis_points: Option<usize>, ) -> Result<Option<Vec<f64>>, Error>
Sourcepub fn projected_y_coordinates(&self) -> Result<Option<Vec<f64>>, Error>
pub fn projected_y_coordinates(&self) -> Result<Option<Vec<f64>>, Error>
Projected y coordinates in metres relative to the first grid point.
Regular latitude/longitude grids return None; use
LatLonGrid::latitudes for those grids.
pub fn projected_y_coordinates_with_limit( &self, max_axis_points: Option<usize>, ) -> Result<Option<Vec<f64>>, Error>
pub fn validate_supported_scan_order(&self) -> Result<(), Error>
pub fn reorder_for_ndarray_in_place<T>( &self, values: &mut [T], ) -> Result<(), Error>
pub fn parse(section_bytes: &[u8]) -> Result<GridDefinition, Error>
Trait Implementations§
Source§impl Clone for GridDefinition
impl Clone for GridDefinition
Source§fn clone(&self) -> GridDefinition
fn clone(&self) -> GridDefinition
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GridDefinition
impl Debug for GridDefinition
Source§impl PartialEq for GridDefinition
impl PartialEq for GridDefinition
Source§fn eq(&self, other: &GridDefinition) -> bool
fn eq(&self, other: &GridDefinition) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for GridDefinition
Auto Trait Implementations§
impl Freeze for GridDefinition
impl RefUnwindSafe for GridDefinition
impl Send for GridDefinition
impl Sync for GridDefinition
impl Unpin for GridDefinition
impl UnsafeUnpin for GridDefinition
impl UnwindSafe for GridDefinition
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more