Skip to main content

VrtBuilder

Struct VrtBuilder 

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

VRT builder for creating VRT datasets

Implementations§

Source§

impl VrtBuilder

Source

pub fn new() -> Self

Creates a new VRT builder

Source

pub fn with_size(width: u64, height: u64) -> Self

Creates a VRT builder with specified dimensions

Source

pub fn with_vrt_path<P: Into<PathBuf>>(self, path: P) -> Self

Sets the VRT file path (for resolving relative source paths)

Source

pub fn with_srs<S: Into<String>>(self, srs: S) -> Self

Sets the spatial reference system

Source

pub fn with_geo_transform(self, geo_transform: GeoTransform) -> Self

Sets the GeoTransform

Source

pub fn with_block_size(self, width: u32, height: u32) -> Self

Sets the block size

Source

pub fn add_source<P: AsRef<Path>>( self, path: P, band_num: usize, source_band: usize, ) -> Result<Self>

Adds a simple source to a band

§Errors

Returns an error if the source configuration is invalid

Source

pub fn add_source_with_window<P: AsRef<Path>>( self, path: P, band_num: usize, source_band: usize, src_rect: PixelRect, dst_rect: PixelRect, ) -> Result<Self>

Adds a source with a window to a band

§Errors

Returns an error if the source configuration is invalid

Source

pub fn add_tile<P: AsRef<Path>>( self, path: P, x_off: u64, y_off: u64, width: u64, height: u64, ) -> Result<Self>

Adds a mosaic tile at a specific position

§Errors

Returns an error if the tile configuration is invalid

Source

pub fn add_tile_grid<P>( self, paths: &[P], tile_width: u64, tile_height: u64, cols: usize, ) -> Result<Self>
where P: AsRef<Path>,

Adds a mosaic tile grid (NxM tiles)

§Errors

Returns an error if the tile configuration is invalid

Source

pub fn add_band(self, band: VrtBand) -> Result<Self>

Adds a full band configuration

§Errors

Returns an error if the band is invalid

Source

pub fn set_dimensions(self, width: u64, height: u64) -> Self

Sets the dataset dimensions explicitly

Source

pub fn build(self) -> Result<VrtDataset>

Builds the VRT dataset

§Errors

Returns an error if the dataset configuration is invalid

Source

pub fn build_file<P: AsRef<Path>>(self, path: P) -> Result<VrtDataset>

Builds and writes the VRT to a file

§Errors

Returns an error if building or writing fails

Trait Implementations§

Source§

impl Default for VrtBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, 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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more