Skip to main content

GeoTiffFile

Struct GeoTiffFile 

Source
pub struct GeoTiffFile { /* private fields */ }
Expand description

A GeoTIFF file handle with geospatial metadata.

Implementations§

Source§

impl GeoTiffFile

Source

pub fn open<P: AsRef<Path>>(path: P) -> Result<Self>

Open a GeoTIFF file from disk.

Source

pub fn open_with_options<P: AsRef<Path>>( path: P, options: GeoTiffOpenOptions, ) -> Result<Self>

Open a GeoTIFF file from disk with explicit TIFF decoder options.

Source

pub unsafe fn open_mmap<P: AsRef<Path>>(path: P) -> Result<Self>

Open a GeoTIFF file from disk using memory-mapped I/O.

§Safety

The caller must guarantee that the mapped file is not mutated or truncated while the returned GeoTiffFile is alive. This includes writes through other file handles and writes from other processes.

Source

pub unsafe fn open_mmap_with_options<P: AsRef<Path>>( path: P, options: GeoTiffOpenOptions, ) -> Result<Self>

Open a GeoTIFF file from disk using memory-mapped I/O with explicit TIFF decoder options.

§Safety

The caller must guarantee that the mapped file is not mutated or truncated while the returned GeoTiffFile is alive. This includes writes through other file handles and writes from other processes.

Source

pub fn from_bytes(data: Vec<u8>) -> Result<Self>

Open a GeoTIFF from an owned byte buffer.

Source

pub fn from_bytes_with_options( data: Vec<u8>, options: GeoTiffOpenOptions, ) -> Result<Self>

Open a GeoTIFF from bytes with explicit TIFF decoder options.

Source

pub fn tiff(&self) -> &TiffFile

Returns the underlying TIFF file.

Source

pub fn metadata(&self) -> &GeoMetadata

Returns the parsed GeoTIFF metadata.

Source

pub fn epsg(&self) -> Option<u32>

Returns the EPSG code of the coordinate reference system, if present.

Source

pub fn crs(&self) -> &CrsInfo

Returns the extracted CRS information.

Source

pub fn geokeys(&self) -> &GeoKeyDirectory

Returns the parsed GeoKey directory.

Source

pub fn transform(&self) -> Option<&GeoTransform>

Returns the affine transform, if present.

Source

pub fn geo_bounds(&self) -> Option<[f64; 4]>

Returns the geographic bounds as (min_x, min_y, max_x, max_y).

Source

pub fn pixel_to_geo(&self, col: f64, row: f64) -> Option<(f64, f64)>

Convert a pixel coordinate to map coordinates.

Source

pub fn geo_to_pixel(&self, x: f64, y: f64) -> Option<(f64, f64)>

Convert map coordinates to pixel coordinates.

Source

pub fn width(&self) -> u32

Returns the image width in pixels.

Source

pub fn height(&self) -> u32

Returns the image height in pixels.

Source

pub fn band_count(&self) -> u32

Returns the number of bands.

Source

pub fn nodata(&self) -> Option<&str>

Returns the nodata value, if set.

Source

pub fn overview_count(&self) -> usize

Returns the number of internal overview IFDs.

Source

pub fn overview_ifd_index(&self, overview_index: usize) -> Result<usize>

Returns the top-level TIFF IFD index of the requested overview.

Overviews stored in SubIFDs return Error::OverviewHasNoTopLevelIfdIndex.

Source

pub fn overview_ifd(&self, overview_index: usize) -> Result<&Ifd>

Returns the parsed TIFF IFD metadata for the requested overview.

Source

pub fn base_ifd_index(&self) -> usize

Returns the TIFF IFD index of the base-resolution image.

Source

pub fn read_raster<T: TiffSample>(&self) -> Result<ArrayD<T>>

Decode the base-resolution raster into storage-domain typed samples.

Source

pub fn read_window<T: TiffSample>( &self, row_off: usize, col_off: usize, rows: usize, cols: usize, ) -> Result<ArrayD<T>>

Decode a base-resolution pixel window into storage-domain typed samples.

Source

pub fn read_band<T: TiffSample>(&self, band_index: usize) -> Result<ArrayD<T>>

Decode one base-resolution storage-domain band into a typed [height, width] ndarray.

Source

pub fn read_band_window<T: TiffSample>( &self, band_index: usize, row_off: usize, col_off: usize, rows: usize, cols: usize, ) -> Result<ArrayD<T>>

Decode a base-resolution window from one storage-domain band into a typed [rows, cols] ndarray.

Source

pub fn read_decoded_raster<T: TiffSample>(&self) -> Result<ArrayD<T>>

Decode the base-resolution raster into color-decoded typed pixels.

Source

pub fn read_decoded_window<T: TiffSample>( &self, row_off: usize, col_off: usize, rows: usize, cols: usize, ) -> Result<ArrayD<T>>

Decode a base-resolution pixel window into color-decoded typed pixels.

Source

pub fn read_raster_samples<T: TiffSample>(&self) -> Result<ArrayD<T>>

Decode the base-resolution raster into storage-domain typed samples.

This is an explicit alias for Self::read_raster.

Source

pub fn read_window_samples<T: TiffSample>( &self, row_off: usize, col_off: usize, rows: usize, cols: usize, ) -> Result<ArrayD<T>>

Decode a base-resolution pixel window into storage-domain typed samples.

This is an explicit alias for Self::read_window.

Source

pub fn read_overview<T: TiffSample>( &self, overview_index: usize, ) -> Result<ArrayD<T>>

Decode an overview raster into storage-domain typed samples.

Source

pub fn read_decoded_overview<T: TiffSample>( &self, overview_index: usize, ) -> Result<ArrayD<T>>

Decode an overview raster into color-decoded typed pixels.

Source

pub fn read_overview_samples<T: TiffSample>( &self, overview_index: usize, ) -> Result<ArrayD<T>>

Decode an overview raster into storage-domain typed samples.

This is an explicit alias for Self::read_overview.

Source

pub fn read_overview_band<T: TiffSample>( &self, overview_index: usize, band_index: usize, ) -> Result<ArrayD<T>>

Decode one overview storage-domain band into a typed [height, width] ndarray.

Source

pub fn read_overview_window<T: TiffSample>( &self, overview_index: usize, row_off: usize, col_off: usize, rows: usize, cols: usize, ) -> Result<ArrayD<T>>

Decode an overview pixel window into storage-domain typed samples.

Source

pub fn read_decoded_overview_window<T: TiffSample>( &self, overview_index: usize, row_off: usize, col_off: usize, rows: usize, cols: usize, ) -> Result<ArrayD<T>>

Decode an overview pixel window into color-decoded typed pixels.

Source

pub fn read_overview_band_window<T: TiffSample>( &self, overview_index: usize, band_index: usize, row_off: usize, col_off: usize, rows: usize, cols: usize, ) -> Result<ArrayD<T>>

Decode an overview pixel window from one storage-domain band into a typed [rows, cols] ndarray.

Source

pub fn read_overview_window_samples<T: TiffSample>( &self, overview_index: usize, row_off: usize, col_off: usize, rows: usize, cols: usize, ) -> Result<ArrayD<T>>

Decode an overview pixel window into storage-domain typed samples.

This is an explicit alias for Self::read_overview_window.

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

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

Initializes a with the given initializer. Read more
Source§

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

Dereferences the given pointer. Read more
Source§

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

Mutably dereferences the given pointer. Read more
Source§

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 = 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.