xrspatial.geotiff.read_vrt#
- xrspatial.geotiff.read_vrt(source: str, *, dtype=None, window=None, band: int | None = None, name: str | None = None, chunks: int | tuple | None = None, gpu: bool = False, max_pixels: int | None = None) DataArray[source]#
Read a GDAL Virtual Raster Table (.vrt) into an xarray.DataArray.
The VRT’s source GeoTIFFs are read via windowed reads and assembled into a single array.
- Parameters:
source (str) – Path to the .vrt file.
dtype (str, numpy.dtype, or None) – Cast the result to this dtype after reading. None keeps the file’s native dtype. Float-to-int casts raise ValueError.
window (tuple or None) – (row_start, col_start, row_stop, col_stop) for windowed reading.
band (int or None) – Band index (0-based). None returns all bands.
name (str or None) – Name for the DataArray.
chunks (int, tuple, or None) – If set, return a Dask-chunked DataArray. int for square chunks, (row, col) tuple for rectangular.
gpu (bool) – If True, return a CuPy-backed DataArray on GPU.
- Returns:
NumPy, Dask, CuPy, or Dask+CuPy backed depending on options.
- Return type:
xr.DataArray