Reads a VRT file and extracts the dataset-level metadata (dimensions, geotransform, SRS, data type, nodata) and per-band source information (file paths, source types, SrcRect, DstRect).

parse_vrt(dsn)

Arguments

dsn

Character string. Path or URL to a VRT file. Supports /vsicurl/ prefixed URLs — the VRT XML will be read via gdalraster::VSIFile for virtual filesystem paths, or xml2::read_xml() for plain paths/URLs.

Value

A list with components:

rasterXSize

Integer. Width of the VRT in pixels.

rasterYSize

Integer. Height of the VRT in pixels.

geotransform

Numeric vector of length 6. The affine geotransform.

srs

Character string. The spatial reference system (WKT or other).

bands

A list of per-band information, each containing a list of sources.

data_type

Character. The data type of band 1 (e.g. "Float32").

nodata

Character or NULL. The nodata value of band 1, if any.

band_count

Integer. Number of bands.

Examples

if (FALSE) { # \dontrun{
info <- parse_vrt("/vsicurl/https://example.com/mosaic.vrt")
str(info)
} # }