pub struct CellSize { /* private fields */ }Expand description
Cell dimensions of a regular grid.
Both x and y are in the same linear units as the elevation values
(typically meters). For geographic DEMs whose native units are degrees,
convert to meters first or use approximate meter-equivalent values.
§Examples
use terrand::CellSize;
// 30-meter SRTM grid
let cs = CellSize::square(30.0).unwrap();
assert_eq!(cs.x(), 30.0);
assert_eq!(cs.y(), 30.0);
// Non-square pixels
let cs = CellSize::new(25.0, 30.0).unwrap();Implementations§
Source§impl CellSize
impl CellSize
Sourcepub fn new(x: f64, y: f64) -> Result<Self>
pub fn new(x: f64, y: f64) -> Result<Self>
Create a cell size with independent x and y dimensions.
Both dimensions must be positive and finite.
§Errors
Returns Error::InvalidCellSize if either dimension is zero,
negative, NaN, or infinite.
Trait Implementations§
impl Copy for CellSize
impl StructuralPartialEq for CellSize
Auto Trait Implementations§
impl Freeze for CellSize
impl RefUnwindSafe for CellSize
impl Send for CellSize
impl Sync for CellSize
impl Unpin for CellSize
impl UnsafeUnpin for CellSize
impl UnwindSafe for CellSize
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