pub struct RasterStreamWriter { /* private fields */ }Expand description
Async raster stream writer.
Accepts chunks via write_chunk and writes a complete
GeoTIFF when finalize is called.
Implementations§
Source§impl RasterStreamWriter
impl RasterStreamWriter
Sourcepub async fn new<P: AsRef<Path>>(
path: P,
metadata: RasterMetadata,
config: RasterStreamConfig,
) -> Result<Self>
pub async fn new<P: AsRef<Path>>( path: P, metadata: RasterMetadata, config: RasterStreamConfig, ) -> Result<Self>
Create a new raster stream writer.
Sourcepub fn calculate_chunks(
width: usize,
height: usize,
chunk_width: usize,
chunk_height: usize,
overlap: usize,
) -> (usize, usize)
pub fn calculate_chunks( width: usize, height: usize, chunk_width: usize, chunk_height: usize, overlap: usize, ) -> (usize, usize)
Calculate the number of chunks needed.
Sourcepub async fn write_chunk(&self, chunk: RasterChunk) -> Result<()>
pub async fn write_chunk(&self, chunk: RasterChunk) -> Result<()>
Write a chunk to the raster.
Chunks are stored in memory and written to disk on finalize.
Sourcepub async fn write_chunks(&self, chunks: Vec<RasterChunk>) -> Result<()>
pub async fn write_chunks(&self, chunks: Vec<RasterChunk>) -> Result<()>
Write multiple chunks.
Sourcepub async fn stats(&self) -> ChunkStats
pub async fn stats(&self) -> ChunkStats
Get statistics for written chunks.
Sourcepub async fn flush(&self) -> Result<()>
pub async fn flush(&self) -> Result<()>
Flush — no-op for the accumulation model (all data is held in memory).
Sourcepub async fn finalize(&self) -> Result<()>
pub async fn finalize(&self) -> Result<()>
Finalize the raster file.
Assembles all accumulated chunks into a contiguous pixel buffer and
writes a GeoTIFF using the oxigdal-geotiff driver.
Sourcepub fn total_chunks(&self) -> (usize, usize)
pub fn total_chunks(&self) -> (usize, usize)
Get the total number of chunks.
Sourcepub async fn current_position(&self) -> (usize, usize)
pub async fn current_position(&self) -> (usize, usize)
Get the current write position (number of chunks written so far).
Auto Trait Implementations§
impl !RefUnwindSafe for RasterStreamWriter
impl !UnwindSafe for RasterStreamWriter
impl Freeze for RasterStreamWriter
impl Send for RasterStreamWriter
impl Sync for RasterStreamWriter
impl Unpin for RasterStreamWriter
impl UnsafeUnpin for RasterStreamWriter
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