Struct esri_ascii_grid::header::EsriASCIIRasterHeader

source ·
pub struct EsriASCIIRasterHeader<T, U>
where T: Numerical, U: Numerical,
{ pub ncols: usize, pub nrows: usize, pub xll: T, pub yll: T, pub yur: T, pub xur: T, pub cornertype: CornerType, pub cellsize: T, pub nodata_value: Option<U>, }
Expand description

A reader for ESRI ASCII raster files. This reader reads the header of the file and then reads the data on demand. The data is cached in memory, so that the file is only read once.

§Type Parameters

  • R - The type of the file. This should be a file that implements Read and Seek.
  • T - The type of the coordinates. Should be a number.
  • U - The type of the height values in the grid. Should be a number

Fields§

§ncols: usize§nrows: usize§xll: T§yll: T§yur: T§xur: T§cornertype: CornerType§cellsize: T§nodata_value: Option<U>

Implementations§

source§

impl<T, U> EsriASCIIRasterHeader<T, U>
where T: Numerical, Error: From<<T as Numerical>::Err> + From<<U as Numerical>::Err>, U: Numerical,

source

pub fn new( ncols: usize, nrows: usize, xll: T, yll: T, cornertype: CornerType, cellsize: T, nodata_value: Option<U> ) -> Self

source

pub fn num_rows(&self) -> usize

source

pub fn num_cols(&self) -> usize

source

pub fn min_x(&self) -> T

source

pub fn max_x(&self) -> T

source

pub fn min_y(&self) -> T

source

pub fn max_y(&self) -> T

source

pub fn cell_size(&self) -> T

source

pub fn no_data_value(&self) -> Option<U>

source

pub fn corner_type(&self) -> CornerType

ESRI ASCII files can have either a corner or center cell type.

If the cell type is corner, the values are the at coordinates of the bottom left corner of the cell.

If the cell type is center, the values are the at coordinates of the center of the cell.

source

pub fn index_pos(&self, row: usize, col: usize) -> Option<(T, T)>

Get the x and y coordinates of the cell at the given row and column, or nothing if it is out of bounds.

source

pub fn index_of(&self, x: T, y: T) -> Option<(usize, usize)>

Get the row and column index of the cell that contains the given x and y, or nothing if it is out of bounds.

Trait Implementations§

source§

impl<T, U> Clone for EsriASCIIRasterHeader<T, U>
where T: Numerical + Clone, U: Numerical + Clone,

source§

fn clone(&self) -> EsriASCIIRasterHeader<T, U>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T, U> Debug for EsriASCIIRasterHeader<T, U>
where T: Numerical + Debug, U: Numerical + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T, U> Copy for EsriASCIIRasterHeader<T, U>
where T: Numerical + Copy, U: Numerical + Copy,

Auto Trait Implementations§

§

impl<T, U> Freeze for EsriASCIIRasterHeader<T, U>
where T: Freeze, U: Freeze,

§

impl<T, U> RefUnwindSafe for EsriASCIIRasterHeader<T, U>

§

impl<T, U> Send for EsriASCIIRasterHeader<T, U>
where T: Send, U: Send,

§

impl<T, U> Sync for EsriASCIIRasterHeader<T, U>
where T: Sync, U: Sync,

§

impl<T, U> Unpin for EsriASCIIRasterHeader<T, U>
where T: Unpin, U: Unpin,

§

impl<T, U> UnwindSafe for EsriASCIIRasterHeader<T, U>
where T: UnwindSafe, U: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.