pub struct Dem {
pub raster: RasterData,
pub cell_size: f64,
}Expand description
Digital Elevation Model wrapping a RasterData grid with a known cell size.
Fields§
§raster: RasterDataUnderlying raster elevation data.
cell_size: f64Physical size of each square cell (metres).
Implementations§
Source§impl Dem
impl Dem
Sourcepub fn new(raster: RasterData, cell_size: f64) -> Self
pub fn new(raster: RasterData, cell_size: f64) -> Self
Construct a new Dem from a RasterData and a cell size.
Sourcepub fn flow_direction(&self) -> Vec<Vec<u8>>
pub fn flow_direction(&self) -> Vec<Vec<u8>>
Compute an 8-direction flow-direction grid (D8 algorithm).
Encoded directions: 1=E, 2=SE, 4=S, 8=SW, 16=W, 32=NW, 64=N, 128=NE.
Sourcepub fn flow_accumulation(&self) -> Vec<Vec<f64>>
pub fn flow_accumulation(&self) -> Vec<Vec<f64>>
Compute flow-accumulation grid (number of upstream cells).
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.