pub struct RasterStreamReader { /* private fields */ }Expand description
Async raster stream reader.
Reads real GeoTIFF files, extracting metadata from IFD tags and reading actual tile/strip data for each chunk.
Implementations§
Source§impl RasterStreamReader
impl RasterStreamReader
Sourcepub async fn new<P: AsRef<Path>>(
path: P,
config: RasterStreamConfig,
) -> Result<Self>
pub async fn new<P: AsRef<Path>>( path: P, config: RasterStreamConfig, ) -> Result<Self>
Create a new raster stream reader.
Opens the GeoTIFF file and reads its metadata (dimensions, data type, geotransform, CRS, nodata value) from the TIFF IFD.
Sourcepub fn with_bands(self, bands: Vec<usize>) -> Self
pub fn with_bands(self, bands: Vec<usize>) -> Self
Set which bands to read.
Sourcepub async fn read_chunk(&self, row: usize, col: usize) -> Result<RasterChunk>
pub async fn read_chunk(&self, row: usize, col: usize) -> Result<RasterChunk>
Read a specific chunk from the raster.
This actually reads tile/strip data from the GeoTIFF file for the given chunk coordinates.
Sourcepub async fn read_chunks(
&self,
chunks: Vec<(usize, usize)>,
) -> Result<Vec<RasterChunk>>
pub async fn read_chunks( &self, chunks: Vec<(usize, usize)>, ) -> Result<Vec<RasterChunk>>
Read multiple chunks in parallel.
Sourcepub fn metadata(&self) -> &RasterMetadata
pub fn metadata(&self) -> &RasterMetadata
Get the metadata for this raster.
Sourcepub fn config(&self) -> &RasterStreamConfig
pub fn config(&self) -> &RasterStreamConfig
Get the stream configuration.
Sourcepub fn format(&self) -> RasterFormat
pub fn format(&self) -> RasterFormat
Get the detected file format.
Trait Implementations§
Source§impl RasterStreaming for RasterStreamReader
impl RasterStreaming for RasterStreamReader
Source§fn next_chunk<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<RasterChunk>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn next_chunk<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<RasterChunk>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the next chunk from the stream.
Source§fn next_chunks<'life0, 'async_trait>(
&'life0 mut self,
count: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<RasterChunk>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn next_chunks<'life0, 'async_trait>(
&'life0 mut self,
count: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<RasterChunk>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get multiple chunks in parallel.
Source§fn seek_to_chunk<'life0, 'async_trait>(
&'life0 mut self,
row: usize,
col: usize,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn seek_to_chunk<'life0, 'async_trait>(
&'life0 mut self,
row: usize,
col: usize,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Skip to a specific chunk by index.
Source§fn total_chunks(&self) -> (usize, usize)
fn total_chunks(&self) -> (usize, usize)
Get the total number of chunks.
Source§fn current_position(&self) -> (usize, usize)
fn current_position(&self) -> (usize, usize)
Get the current position in the stream.
Source§fn has_more_chunks(&self) -> bool
fn has_more_chunks(&self) -> bool
Check if the stream has more chunks.
Auto Trait Implementations§
impl !RefUnwindSafe for RasterStreamReader
impl !UnwindSafe for RasterStreamReader
impl Freeze for RasterStreamReader
impl Send for RasterStreamReader
impl Sync for RasterStreamReader
impl Unpin for RasterStreamReader
impl UnsafeUnpin for RasterStreamReader
Blanket Implementations§
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
Mutably borrows from an owned value. Read more