vrt {terra} | R Documentation |
Create a Virtual Raster Tiles (VRT) dataset from a collection of file-based raster datasets.
## S4 method for signature 'character'
vrt(x, filename="", options=NULL, overwrite=FALSE)
x |
character. Filenames of raster "tiles". See |
filename |
character. Output VRT filename |
options |
character. Options as for https://gdal.org/programs/gdalbuildvrt.htmlgdalbuildvrt |
overwrite |
logical. Should |
SpatRaster
makeTiles
to create tiles; makeVRT
to create a .vrt file for a file without a header
r <- rast(ncols=100, nrows=100)
values(r) <- 1:ncell(r)
x <- rast(ncols=2, nrows=2)
filename <- paste0(tempfile(), "_.tif")
ff <- makeTiles(r, x, filename)
ff
vrtfile <- paste0(tempfile(), ".vrt")
v <- vrt(ff, vrtfile)
head(readLines(vrtfile))
v