vrt.build_vrt_mosaic()

Mosaic aligned, single-band tiles into a VRT.

Usage

Source

vrt.build_vrt_mosaic(
    files,
    dst_vrt,
    *,
    bounds=None,
)

Sources beside the VRT are referenced by bare filename, which keeps the pair relocatable; sources elsewhere are referenced by absolute GDAL path.

Parameters

files: Sequence[str | Path | UPath]

Source tiles, sharing a CRS, pixel size, dtype and NODATA value.

dst_vrt: str | Path | UPath

Output VRT.

bounds: rasterio.coords.BoundingBox or tuple of float or None = None
Extent of the mosaic as (left, bottom, right, top). Defaults to the union of the sources. Pass a fixed extent to place every mosaic of a series on one canonical grid, so they can be stacked without alignment.

Raises

ValueError
If inputs are empty or incompatible, or if bounds does not lie on the sources’ pixel grid.