pub struct VrtDataset {
pub raster_x_size: u64,
pub raster_y_size: u64,
pub geo_transform: Option<GeoTransform>,
pub srs: Option<String>,
pub bands: Vec<VrtBand>,
pub block_size: Option<(u32, u32)>,
pub subclass: Option<VrtSubclass>,
pub vrt_path: Option<PathBuf>,
}Expand description
VRT dataset
Fields§
§raster_x_size: u64Raster width in pixels
raster_y_size: u64Raster height in pixels
geo_transform: Option<GeoTransform>GeoTransform (affine transform for georeferencing)
srs: Option<String>Spatial reference system (WKT or PROJ.4 string)
bands: Vec<VrtBand>Bands
block_size: Option<(u32, u32)>Block size (default tile dimensions)
subclass: Option<VrtSubclass>Subclass (for special VRT types)
vrt_path: Option<PathBuf>VRT file path (for resolving relative paths)
Implementations§
Source§impl VrtDataset
impl VrtDataset
Sourcepub fn from_bands(bands: Vec<VrtBand>) -> Result<Self>
pub fn from_bands(bands: Vec<VrtBand>) -> Result<Self>
Creates a new VRT dataset with extent from sources
§Errors
Returns an error if no bands are provided
Sourcepub fn with_geo_transform(self, geo_transform: GeoTransform) -> Self
pub fn with_geo_transform(self, geo_transform: GeoTransform) -> Self
Sets the GeoTransform
Sourcepub fn with_block_size(self, width: u32, height: u32) -> Self
pub fn with_block_size(self, width: u32, height: u32) -> Self
Sets the block size
Sourcepub fn with_subclass(self, subclass: VrtSubclass) -> Self
pub fn with_subclass(self, subclass: VrtSubclass) -> Self
Sets the subclass
Sourcepub fn with_vrt_path<P: Into<PathBuf>>(self, path: P) -> Self
pub fn with_vrt_path<P: Into<PathBuf>>(self, path: P) -> Self
Sets the VRT file path
Sourcepub fn band_count(&self) -> usize
pub fn band_count(&self) -> usize
Gets the number of bands
Sourcepub fn get_band_mut(&mut self, index: usize) -> Option<&mut VrtBand>
pub fn get_band_mut(&mut self, index: usize) -> Option<&mut VrtBand>
Gets a mutable reference to a band by index (0-based)
Sourcepub fn effective_block_size(&self) -> (u32, u32)
pub fn effective_block_size(&self) -> (u32, u32)
Gets the effective block size (uses dataset default or falls back to 256x256)
Sourcepub fn merge_geo_transforms(&mut self) -> Result<()>
pub fn merge_geo_transforms(&mut self) -> Result<()>
Merges GeoTransforms from multiple sources to create a unified transform
§Errors
Returns an error if sources have incompatible GeoTransforms
Sourcepub fn primary_data_type(&self) -> Option<RasterDataType>
pub fn primary_data_type(&self) -> Option<RasterDataType>
Gets the data type of the first band
Sourcepub fn has_uniform_data_type(&self) -> bool
pub fn has_uniform_data_type(&self) -> bool
Checks if all bands have the same data type
Trait Implementations§
Source§impl Clone for VrtDataset
impl Clone for VrtDataset
Source§fn clone(&self) -> VrtDataset
fn clone(&self) -> VrtDataset
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more