pub struct Template3_10 {Show 13 fields
pub earth_shape: EarthShape,
pub ni: u32,
pub nj: u32,
pub first_point_lat: i32,
pub first_point_lon: u32,
pub resolution_and_component_flags: ResolutionAndComponentFlags,
pub lad: i32,
pub last_point_lat: i32,
pub last_point_lon: u32,
pub scanning_mode: ScanningMode,
pub orientation: u32,
pub di: u32,
pub dj: u32,
}Expand description
Grid definition template 3.10 - Mercator.
§Examples
use std::io::{BufReader, Read};
use grib::{
TryFromSlice,
def::grib2::template::{Template3_10, param_set},
};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut buf = Vec::new();
let f = std::fs::File::open("testdata/ds.wwa.bin.xz")?;
let f = BufReader::new(f);
let mut f = xz2::bufread::XzDecoder::new(f);
f.read_to_end(&mut buf)?;
let mut pos = 0xa6;
let actual = Template3_10::try_from_slice(&buf, &mut pos)?;
let expected = Template3_10 {
earth_shape: param_set::EarthShape {
shape: 1,
spherical_earth_radius: param_set::ScaledValue {
scale_factor: 0,
scaled_value: 6371200,
},
major_axis: param_set::ScaledValue {
scale_factor: 0,
scaled_value: 0,
},
minor_axis: param_set::ScaledValue {
scale_factor: 0,
scaled_value: 0,
},
},
ni: 2517,
nj: 1793,
first_point_lat: -30419200,
first_point_lon: 129906005,
resolution_and_component_flags: param_set::ResolutionAndComponentFlags(0b00000000),
lad: 20000000,
last_point_lat: 80010000,
last_point_lon: 10710000,
scanning_mode: param_set::ScanningMode(0b01010000),
orientation: 0,
di: 10000000,
dj: 10000000,
};
assert_eq!(actual, expected);
Ok(())
}Fields§
§earth_shape: EarthShape§ni: u32Ni - number of points along a parallel.
nj: u32Nj - number of points along a meridian.
first_point_lat: i32La1 - latitude of first grid point.
first_point_lon: u32Lo1 - longitude of first grid point.
resolution_and_component_flags: ResolutionAndComponentFlags§lad: i32LaD - Latitude(s) at which the Mercator projection intersects the Earth (Latitude(s) where Di and Dj are specified).
last_point_lat: i32La2 - latitude of last grid point.
last_point_lon: u32Lo2 - longitude of last grid point.
scanning_mode: ScanningMode§orientation: u32Orientation of the grid, angle between i direction on the map and the equator (see Note 1).
di: u32Di - longitudinal direction grid length (see Note 2).
dj: u32Dj - latitudinal direction grid length (see Note 2).
Trait Implementations§
Source§impl Clone for Template3_10
impl Clone for Template3_10
Source§fn clone(&self) -> Template3_10
fn clone(&self) -> Template3_10
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Template3_10
impl Debug for Template3_10
Source§impl Dump for Template3_10
impl Dump for Template3_10
impl Eq for Template3_10
Source§impl GridPointIndex for Template3_10
impl GridPointIndex for Template3_10
Source§fn grid_shape(&self) -> (usize, usize)
fn grid_shape(&self) -> (usize, usize)
Returns the shape of the grid, i.e. a tuple of the number of grids in
the i and j directions.
Source§fn scanning_mode(&self) -> &ScanningMode
fn scanning_mode(&self) -> &ScanningMode
Returns
ScanningMode used for the iteration.Source§impl GridShortName for Template3_10
impl GridShortName for Template3_10
Source§fn short_name(&self) -> &'static str
fn short_name(&self) -> &'static str
Returns the grid type. Read more
Source§impl LatLons for Template3_10
impl LatLons for Template3_10
type Iter<'a> = IntoIter<(f32, f32)>
Source§fn latlons_unchecked<'a>(&'a self) -> Result<Self::Iter<'a>, GribError>
fn latlons_unchecked<'a>(&'a self) -> Result<Self::Iter<'a>, GribError>
Computes and returns an iterator over latitudes and longitudes of grid
points in degrees. Unlike the return values from
LatLons::latlons,
the longitude values from thie method do not necessarily fall within
the range [-180°, 180°].Source§impl PartialEq for Template3_10
impl PartialEq for Template3_10
impl StructuralPartialEq for Template3_10
Source§impl TryFromSlice for Template3_10
impl TryFromSlice for Template3_10
Source§impl WriteToBuffer for Template3_10
impl WriteToBuffer for Template3_10
Auto Trait Implementations§
impl Freeze for Template3_10
impl RefUnwindSafe for Template3_10
impl Send for Template3_10
impl Sync for Template3_10
impl Unpin for Template3_10
impl UnsafeUnpin for Template3_10
impl UnwindSafe for Template3_10
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
Mutably borrows from an owned value. Read more