Learn R Programming

terra (version 1.3-22)

vrt: Virtual Raster Tiles

Description

Create a Virtual Raster Tiles (VRT) dataset from file-based raster datasets.

Usage

# S4 method for character
vrt(x, filename="", 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(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
# }

Run the code above in your browser using DataLab