pub struct RasterDataset {
pub raster: Raster,
pub driver: RasterDriver,
pub has_nodata: bool,
pub affine: Option<[f64; 6]>,
pub complex: bool,
pub geolocation: Option<Geolocation>,
}Expand description
A raster dataset read into memory.
Fields§
§raster: RasterThe pixels and georeferencing.
driver: RasterDriverThe driver that read it.
has_nodata: boolWhether the file declares a nodata value (the raster always carries one).
affine: Option<[f64; 6]>The geotransform of a rotated or south-up raster, which the raster’s origin and cell sizes
cannot hold (they then hold the extent of its footprint); None for north-up rasters.
Set it with RasterDataset::set_geo_transform.
complex: boolWhether the bands hold complex numbers, as GDAL’s CInt16, CInt32, CFloat32 and
CFloat64 bands: each complex band is two bands of raster, its real parts then its
imaginary parts, of the parts’ type (Int16 for CInt16). Band k (from 0) of the
dataset is bands 2k and 2k + 1 of the raster.
geolocation: Option<Geolocation>Geolocation arrays, as GDAL’s GEOLOCATION metadata: for swaths and other rasters
georeferenced by a longitude and a latitude per pixel rather than a geotransform.
Implementations§
Source§impl RasterDataset
impl RasterDataset
Sourcepub fn set_geo_transform(&mut self, gt: [f64; 6])
pub fn set_geo_transform(&mut self, gt: [f64; 6])
Sets the geotransform: a north-up one goes to the raster’s origin and cell sizes; a rotated
or south-up one is kept in RasterDataset::affine, the raster’s origin and cell sizes
then describing the bounding box of its footprint.
Sourcepub fn with_driver(
raster: Raster,
driver: RasterDriver,
has_nodata: bool,
) -> Self
pub fn with_driver( raster: Raster, driver: RasterDriver, has_nodata: bool, ) -> Self
Wraps a raster read by a driver: real-valued bands, without geolocation arrays.
Sourcepub fn band_count(&self) -> usize
pub fn band_count(&self) -> usize
The number of bands as GDAL counts them: complex bands count once.
Sourcepub fn data_type_name(&self) -> String
pub fn data_type_name(&self) -> String
GDAL’s name of the bands’ data type: Int16, Float32… and CInt16, CFloat32…
for complex bands.
Sourcepub fn crs(&self) -> SpatialRef
pub fn crs(&self) -> SpatialRef
The CRS.
Sourcepub fn geo_transform(&self) -> [f64; 6]
pub fn geo_transform(&self) -> [f64; 6]
The GDAL-style geotransform: [x_origin, pixel_width, row_rotation, y_origin, column_rotation, pixel_height], [x_origin, pixel_width, 0, y_origin, 0, -pixel_height] for
north-up rasters.
Trait Implementations§
Source§impl Clone for RasterDataset
impl Clone for RasterDataset
Source§impl Debug for RasterDataset
impl Debug for RasterDataset
Source§impl From<RasterDataset> for LazyRaster
impl From<RasterDataset> for LazyRaster
Source§fn from(ds: RasterDataset) -> Self
fn from(ds: RasterDataset) -> Self
Wraps a raster in memory, so that it is read by window like a lazy one.
Auto Trait Implementations§
impl Freeze for RasterDataset
impl RefUnwindSafe for RasterDataset
impl Send for RasterDataset
impl Sync for RasterDataset
impl Unpin for RasterDataset
impl UnsafeUnpin for RasterDataset
impl UnwindSafe for RasterDataset
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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