pub struct GeoTIFFImage<T: Reader> { /* private fields */ }Expand description
§GeoTIFF Image Container
§Description
A Container for a GeoTIFF image
§Usage
The methods you have access to:
GeoTIFFImage::new: Create a new GeoTIFFImageGeoTIFFImage::width: Get the image widthGeoTIFFImage::height: Get the image heightGeoTIFFImage::tile_width: Get the tile widthGeoTIFFImage::tile_height: Get the tile heightGeoTIFFImage::block_width: Get the block widthGeoTIFFImage::block_height: Get the block heightGeoTIFFImage::bytes_per_pixel: Calculates the number of bytes for each pixel across all samples.GeoTIFFImage::samples_per_pixel: The number of samples per pixelGeoTIFFImage::get_sample_format: Returns the sample formatGeoTIFFImage::get_bits_per_sample: Returns the number of bits per sampleGeoTIFFImage::raster_array_type: Convert the data format and bits per sample to the appropriate array typeGeoTIFFImage::get_tie_point: Returns an array of tiepoints.GeoTIFFImage::origin: Returns the image origin as a XYZ-vector.GeoTIFFImage::origin_ll: Returns the image origin as a XYZ-vector in lon-lat space.GeoTIFFImage::resolution: Returns the image resolution as a XYZ-vector.GeoTIFFImage::resolution_ll: Returns the image resolution as a XYZ-vector in lon-lat space.GeoTIFFImage::pixel_is_area: Returns whether or not the pixels of the image depict an area (or point).GeoTIFFImage::get_bbox: Returns the image bounding box as an array of 4 values: min-x, min-y, max-x and max-y.GeoTIFFImage::raster_data: Returns the raster data of the image.GeoTIFFImage::get_rgba: Returns the RGBA raster data of the image.GeoTIFFImage::get_multi_point_vector: Build a vector feature from the image
The methods you probably care about are get_bbox, raster_data, get_rgba,
and get_multi_point_vector
Implementations§
Source§impl<T: Reader> GeoTIFFImage<T>
impl<T: Reader> GeoTIFFImage<T>
Sourcepub fn new(
reader: Rc<RefCell<T>>,
image_directory: ImageDirectory,
transformer: Rc<RefCell<Transformer>>,
little_endian: bool,
) -> Self
pub fn new( reader: Rc<RefCell<T>>, image_directory: ImageDirectory, transformer: Rc<RefCell<Transformer>>, little_endian: bool, ) -> Self
Create a new GeoTIFFImage
Sourcepub fn tile_width(&self) -> usize
pub fn tile_width(&self) -> usize
Get the tile width
Sourcepub fn tile_height(&self) -> usize
pub fn tile_height(&self) -> usize
Get the tile height
Sourcepub fn block_width(&self) -> usize
pub fn block_width(&self) -> usize
Get the block width
Sourcepub fn block_height(&self, y: usize) -> usize
pub fn block_height(&self, y: usize) -> usize
Get the block height
Sourcepub fn bytes_per_pixel(&self) -> usize
pub fn bytes_per_pixel(&self) -> usize
Calculates the number of bytes for each pixel across all samples. Only full bytes are supported, an exception is thrown when this is not the case.
§Returns
the bytes per pixel
Sourcepub fn samples_per_pixel(&self) -> usize
pub fn samples_per_pixel(&self) -> usize
§Returns
The number of samples per pixel
Sourcepub fn get_sample_format(&self, sample_index: Option<usize>) -> u16
pub fn get_sample_format(&self, sample_index: Option<usize>) -> u16
Sourcepub fn get_bits_per_sample(&self, sample_index: Option<usize>) -> u16
pub fn get_bits_per_sample(&self, sample_index: Option<usize>) -> u16
Sourcepub fn raster_array_type(&self) -> GTiffDataType
pub fn raster_array_type(&self) -> GTiffDataType
Sourcepub fn get_tie_point(&self) -> GeoTiePoint
pub fn get_tie_point(&self) -> GeoTiePoint
Returns an array of tiepoints.
Sourcepub fn origin(&self) -> VectorPoint<()>
pub fn origin(&self) -> VectorPoint<()>
Returns the image origin as a XYZ-vector. When the image has no affine transformation, then an exception is thrown.
§Returns
The origin as a vector
Sourcepub fn origin_ll(&self) -> VectorPoint<()>
pub fn origin_ll(&self) -> VectorPoint<()>
Returns the image origin as a XYZ-vector in lon-lat space. When the image has no affine transformation, then an exception is thrown.
§Returns
The origin as a lon-lat vector
Sourcepub fn resolution(&self) -> VectorPoint<()>
pub fn resolution(&self) -> VectorPoint<()>
Returns the image resolution as a XYZ-vector. When the image has no affine transformation, then an exception is thrown. in cases when the current image does not have the required tags on its own.
§Returns
The resolution as a vector
Sourcepub fn resolution_ll(&self) -> VectorPoint<()>
pub fn resolution_ll(&self) -> VectorPoint<()>
Returns the image resolution as a XYZ-vector in lon-lat space. When the image has no affine transformation, then an exception is thrown. in cases when the current image does not have the required tags on its own.
§Returns
The resolution as a lon-lat vector
Sourcepub fn pixel_is_area(&self) -> bool
pub fn pixel_is_area(&self) -> bool
Returns whether or not the pixels of the image depict an area (or point).
§Returns
Whether the pixels are a point
Sourcepub fn get_multi_point_vector(&mut self) -> GeoTIFFVectorFeature
pub fn get_multi_point_vector(&mut self) -> GeoTIFFVectorFeature
Build a vector feature from the image
§Returns
The vector feature with rgba values incoded into the points
Trait Implementations§
Source§impl<T: Clone + Reader> Clone for GeoTIFFImage<T>
impl<T: Clone + Reader> Clone for GeoTIFFImage<T>
Source§fn clone(&self) -> GeoTIFFImage<T>
fn clone(&self) -> GeoTIFFImage<T>
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<T> Freeze for GeoTIFFImage<T>
impl<T> !RefUnwindSafe for GeoTIFFImage<T>
impl<T> !Send for GeoTIFFImage<T>
impl<T> !Sync for GeoTIFFImage<T>
impl<T> Unpin for GeoTIFFImage<T>
impl<T> !UnwindSafe for GeoTIFFImage<T>
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().