Skip to main content

RasterInfo

Struct RasterInfo 

Source
#[non_exhaustive]
pub struct RasterInfo {
Show 15 fields pub width: u32, pub height: u32, pub corner_longitude_deg: f64, pub corner_latitude_deg: f64, pub pixel_longitude_deg: f64, pub pixel_latitude_deg: f64, pub raster_type: RasterType, pub geographic_crs_epsg: u16, pub vertical_crs_epsg: Option<u16>, pub vertical_unit: VerticalUnit, pub vertical_unit_stated: bool, pub scale: f64, pub offset: f64, pub sample: SampleType, pub nodata: Option<f64>,
}
Expand description

What an elevation file says about itself.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§width: u32

Columns.

§height: u32

Rows.

§corner_longitude_deg: f64

Longitude of the outer corner of pixel (0, 0) (its west edge when Δλ > 0), degrees.

§corner_latitude_deg: f64

Latitude of the outer corner of pixel (0, 0) (its north edge when Δφ < 0), degrees.

§pixel_longitude_deg: f64

Δλ: longitude change from one column to the next, degrees.

§pixel_latitude_deg: f64

Δφ: latitude change from one row to the next, degrees; negative when north is up.

§raster_type: RasterType

What the file’s tiepoint names; already applied to the corner above.

§geographic_crs_epsg: u16

The geographic CRS’s EPSG code, one of NEAR_WGS84.

§vertical_crs_epsg: Option<u16>

The vertical CRS’s EPSG code, if the file names one (a user-defined or private code, 32767 and above, is not one).

§vertical_unit: VerticalUnit

The unit pixel values are in, after the scale and offset.

§vertical_unit_stated: bool

Whether the file states that unit (by VerticalUnitsGeoKey, a vertical CRS this reader knows, or a unit type in GDAL’s GDAL_METADATA); false means meters were assumed.

§scale: f64

The pixels’ scale: a raw value v stands for v·scale + offset in the vertical unit.

§offset: f64

The pixels’ offset, in the vertical unit.

§sample: SampleType

The pixels’ sample type.

§nodata: Option<f64>

The nodata value, rounded to the sample type, if the file has one a sample can hold.

Implementations§

Source§

impl RasterInfo

Source

pub fn pixel_of(&self, latitude_deg: f64, longitude_deg: f64) -> Option<Pixel>

The pixel holding a point, by the module’s rule, or None if the point is off the raster. The longitude is tried as given and then 360° to either side, so a file on 0° to 360° reads a longitude given on −180° to 180°.

Source

pub fn bounds(&self) -> Bounds

The raster’s edges.

Source

pub fn meters(&self, value: f64) -> f64

A raw value as a height in meters: (v·scale + offset)·unit.

Trait Implementations§

Source§

impl Clone for RasterInfo

Source§

fn clone(&self) -> RasterInfo

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for RasterInfo

Source§

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

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

impl<'de> Deserialize<'de> for RasterInfo

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for RasterInfo

Source§

fn eq(&self, other: &RasterInfo) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for RasterInfo

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for RasterInfo

Auto Trait Implementations§

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

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

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

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

Source§

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>,

Source§

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>,

Source§

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.