pub struct ParallelGeoTiffWriter {
pub output_path: PathBuf,
pub geo_transform: GeoTransform,
pub epsg_code: u32,
pub total_cols: usize,
pub total_rows: usize,
pub n_bands: usize,
pub dataset: Mutex<Option<Dataset>>,
}Expand description
Writer that allows parallel block writes to a pre-created GeoTIFF.
Thread-safe via internal Mutex. The GDAL dataset is opened once and
kept alive for the writer’s lifetime. Each write_block() call
acquires the Mutex, writes to the appropriate window, and returns.
The dataset is automatically closed when the writer is dropped.
Fields§
§output_path: PathBufPath to the output GeoTIFF file
geo_transform: GeoTransformGeographic transformation parameters
epsg_code: u32EPSG coordinate reference system code
total_cols: usizeTotal image size in pixels
total_rows: usize§n_bands: usizeNumber of bands in the output
dataset: Mutex<Option<Dataset>>Mutex-guarded cached GDAL dataset (opened on first write)
Implementations§
Source§impl ParallelGeoTiffWriter
impl ParallelGeoTiffWriter
Sourcepub fn new(
output_path: PathBuf,
geo_transform: GeoTransform,
epsg_code: u32,
total_cols: usize,
total_rows: usize,
n_bands: usize,
) -> Self
pub fn new( output_path: PathBuf, geo_transform: GeoTransform, epsg_code: u32, total_cols: usize, total_rows: usize, n_bands: usize, ) -> Self
Creates a new writer for the given output path and parameters.
The dataset is not opened until the first write_block() call.
Sourcepub fn build_overviews(&self, resampling: &str, levels: &[i32]) -> Result<()>
pub fn build_overviews(&self, resampling: &str, levels: &[i32]) -> Result<()>
Builds overviews on the written GeoTIFF.
This must be called after all write_block() calls are complete.
It opens the dataset in update mode and calls GDAL’s build_overviews
with GDAL_NUM_THREADS=ALL_CPUS for multithreaded processing.
§Arguments
resampling- Resampling method, e.g. “CUBIC”, “NEAREST”, “AVERAGE”levels- Overview decimation factors, e.g. [2, 4, 8, 16, 32]
Auto Trait Implementations§
impl !Freeze for ParallelGeoTiffWriter
impl RefUnwindSafe for ParallelGeoTiffWriter
impl Send for ParallelGeoTiffWriter
impl Sync for ParallelGeoTiffWriter
impl Unpin for ParallelGeoTiffWriter
impl UnwindSafe for ParallelGeoTiffWriter
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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