Skip to main content

Dataset

Struct Dataset 

Source
pub struct Dataset { /* private fields */ }
Available on crate feature encoder only.
Expand description

An open GDAL dataset. Not Sync: GDAL dataset handles must not be shared between threads, so each worker opens its own.

Implementations§

Source§

impl Dataset

Source

pub fn open(name: &Path) -> Result<Self>

Open a dataset read-only. name is a GDAL connection string, not necessarily a filesystem path — the observation path passes NETCDF:"file.nc":cref.

Source

pub fn size(&self) -> (usize, usize)

Source

pub fn band_count(&self) -> usize

Source

pub fn geo_transform(&self) -> Result<[f64; 6]>

The geotransform as gdalinfo -json reports it (as_gdalinfo_json), not the doubles GDAL holds: the reference encoder reads its grid out of that text, and this is what both the native grid and the wheel’s gdal_info (info_json) are built from.

Source

pub fn projection_wkt(&self) -> String

The dataset’s coordinate system as WKT2, the text gdalinfo -json prints under coordinateSystem.wkt (the same export options: FORMAT=WKT2, multi-line); empty when the dataset declares none. A projected source (HRRR’s Lambert conformal grid) is recognised from it (reproject::lambert_conformal_from_wkt).

Source

pub fn metadata(&self, domain: &str) -> HashMap<String, String>

Dataset-level metadata of one domain ("" is the default domain).

Source

pub fn band_info(&self, number: usize) -> Result<BandInfo>

Source

pub fn bands(&self) -> Result<Vec<BandInfo>>

Source

pub fn read_band_f64(&self, number: usize) -> Result<Vec<f64>>

Read one whole band as float64, in the dataset’s own layout — the same bytes gdal_translate -of ENVI -ot Float64 would have written.

Trait Implementations§

Source§

impl Drop for Dataset

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl Send for Dataset

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
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.