Learn R Programming

terra (version 1.2-5)

vrt: Virtual Raster Tiles

Description

Create a Virtual Raster Tiles (VRT) dataset.

Usage

# S4 method for character
vrt(x, filename="test.vrt", overwrite=FALSE)

Arguments

x

character. Filenames of raster "tiles". See tiles

filename

character. Output VRT filename

overwrite

logical. Should filename be overwritten if it exists?

Value

SpatRaster

Examples

Run this code
# NOT RUN {
r <- rast(ncols=100, nrows=100)
values(r) <- 1:ncell(r)
x <- rast(ncol=2, nrow=2)
filename <- paste0(tempfile(), "_.tif")
ff <- tiles(r, x, filename)
vrtfile <- paste0(tempfile(), ".vrt")
v <- vrt(ff, vrtfile)
head(readLines(vrtfile))
v
# }

Run the code above in your browser using DataLab