variete.vrt.vrt#

Functions#

build_vrt#

variete.vrt.vrt.build_vrt(output_filepath, filepaths, calculate_resolution='average', res=None, separate=False, output_bounds=None, resample_algorithm=Resampling.bilinear, target_aligned_pixels=False, band_list=None, add_alpha=False, output_crs=None, allow_projection_difference=False, src_nodata=None, vrt_nodata=None, strict=True)[source]#
Return type

None

build_warped_vrt#

variete.vrt.vrt.build_warped_vrt(vrt_filepath, filepath, dst_crs, resample_algorithm=Resampling.bilinear, max_error=0.125, src_crs=None)[source]#
Return type

None

dataset_from_etree#

variete.vrt.vrt.dataset_from_etree(elem)[source]#
Return type

VRTDataset | WarpedVRTDataset

load_vrt#

variete.vrt.vrt.load_vrt(filepath)[source]#
Return type

VRTDataset | WarpedVRTDataset

vrt_warp#

variete.vrt.vrt.vrt_warp(output_filepath, input_filepath, dst_crs=None, dst_res=None, dst_shape=None, dst_bounds=None, dst_transform=None, src_nodata=None, dst_nodata=None, resampling='bilinear', multithread=False)[source]#
Return type

None

Classes#

VRTDataset#

class variete.vrt.vrt.VRTDataset(shape, crs, transform, raster_bands, crs_mapping='2,1')[source]#

Bases: object

__init__(shape, crs, transform, raster_bands, crs_mapping='2,1')[source]#
property bounds: BoundingBox#
copy()[source]#
Return type

VRTDataset

crs: CRS#
crs_mapping: str#
classmethod from_etree(root)[source]#
Return type

VRTDataset

classmethod from_file(filepaths, **kwargs)[source]#
Return type

VRTDataset

classmethod from_xml(xml)[source]#
Return type

VRTDataset

is_nested()[source]#
Return type

bool

classmethod load_vrt(filepath)[source]#
Return type

VRTDataset

property n_bands: int#
property open_rio: Callable[[...], DatasetReader]#
open_rio_nested(temp_dir=None)[source]#
Return type

tuple[UnionType[TemporaryDirectory[str], str, Path, None], Callable[..., DatasetReader]]

raster_bands: list[VRTRasterBand | VRTDerivedRasterBand]#
property res: tuple[float, float]#

Return the X/Y resolution of the dataset.

sample(x_coord, y_coord, band=1, masked=False)[source]#
Return type

int | float | ndarray[Any, dtype[Any]]

save_vrt(filepath)[source]#
Return type

None

save_vrt_nested(filepath)[source]#
Return type

list[Path]

sha1()[source]#
Return type

str

shape: tuple[int, int]#
subclass: Optional[str]#
to_etree()[source]#
Return type

Element

to_memfile()[source]#
Return type

MemoryFile

to_memfile_nested(temp_dir)[source]#
Return type

tuple[UnionType[TemporaryDirectory[str], Path, str, None], MemoryFile]

to_tempfiles(temp_dir=None)[source]#
Return type

tuple[TemporaryDirectory[str] | str | Path, Path]

to_xml()[source]#
Return type

str

transform: Affine#

WarpedVRTDataset#

class variete.vrt.vrt.WarpedVRTDataset(shape, crs, transform, raster_bands, resample_algorithm, block_size, dst_dtype, options, source_dataset, band_mapping, src_transform, src_inv_transform, dst_transform, dst_inv_transform, crs_mapping='2,1', relative_filename=None, max_error=0.125, approximate=True, warp_memory_limit=67108900.0)[source]#

Bases: VRTDataset

A VRTDataset that specifies a GDAL warp operation.

__init__(shape, crs, transform, raster_bands, resample_algorithm, block_size, dst_dtype, options, source_dataset, band_mapping, src_transform, src_inv_transform, dst_transform, dst_inv_transform, crs_mapping='2,1', relative_filename=None, max_error=0.125, approximate=True, warp_memory_limit=67108900.0)[source]#
approximate: bool#
band_mapping: list[tuple[int, int]]#
block_size: tuple[int, int]#
crs: CRS#
crs_mapping: str#
dst_dtype: str#
dst_inv_transform: Affine#
dst_transform: Affine#
classmethod from_etree(root)[source]#
Return type

WarpedVRTDataset

classmethod from_file(filepath, dst_crs, **kwargs)[source]#
Return type

VRTDataset

is_nested()[source]#
Return type

bool

max_error: float#
options: dict[str, str]#
raster_bands: list[VRTRasterBand | VRTDerivedRasterBand]#
relative_filename: Optional[bool]#
resample_algorithm: Resampling#
shape: tuple[int, int]#
source_dataset: str | Path#
src_inv_transform: Affine#
src_transform: Affine#
to_etree()[source]#
Return type

Element

transform: Affine#
warp_memory_limit: float#