pub struct Dem {
pub heights: Vec<f64>,
pub rows: usize,
pub cols: usize,
pub cell_size: f64,
pub nodata: f64,
}Expand description
A regular-grid Digital Elevation Model.
Heights are stored in row-major order: index = row * cols + col.
The origin is at the north-west corner; rows increase southward (y+),
columns increase eastward (x+).
Fields§
§heights: Vec<f64>Elevation values (metres), row-major.
rows: usizeNumber of rows.
cols: usizeNumber of columns.
cell_size: f64Cell size in metres (square cells assumed).
nodata: f64No-data sentinel value.
Implementations§
Source§impl Dem
impl Dem
Sourcepub fn get(&self, row: usize, col: usize) -> Option<f64>
pub fn get(&self, row: usize, col: usize) -> Option<f64>
Return the elevation at (row, col), or None if out of bounds.
Sourcepub fn get_clamped(&self, row: i64, col: i64) -> f64
pub fn get_clamped(&self, row: i64, col: i64) -> f64
Return the elevation at (row, col) clamped to grid boundaries.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Dem
impl RefUnwindSafe for Dem
impl Send for Dem
impl Sync for Dem
impl Unpin for Dem
impl UnsafeUnpin for Dem
impl UnwindSafe for Dem
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.