#[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>
pub fn ndarray_shape(&self) -> Vec<usize>
pub fn num_points(&self) -> usize
pub fn checked_num_points(&self) -> Result<usize>
pub fn declared_num_points(&self) -> Option<usize>
Sourcepub fn projected_x_coordinates(&self) -> Result<Option<Vec<f64>>>
pub fn projected_x_coordinates(&self) -> Result<Option<Vec<f64>>>
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>>>
Sourcepub fn projected_y_coordinates(&self) -> Result<Option<Vec<f64>>>
pub fn projected_y_coordinates(&self) -> Result<Option<Vec<f64>>>
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>>>
pub fn validate_supported_scan_order(&self) -> Result<()>
pub fn reorder_for_ndarray_in_place<T>(&self, values: &mut [T]) -> Result<()>
pub fn parse(section_bytes: &[u8]) -> Result<Self>
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 ==.