Skip to contents

Create VRT from a list of DEM files. This function is a simple wrapper of the terra::vrt() function.

Usage

make_vrt(path, filename, overwrite = FALSE)

Arguments

path

Path to directory containing DEM files you wish to assemble into a VRT

filename

Output VRT filename

overwrite

Logical (T/F). Should filename be overwritten if it exists?

Value

A SpatRaster object.

Examples

if (FALSE) {
# Download some BC DEM tiles...
tiles <- c("92h", "93c", "93l", "93m", "104a", "104b")
sapply(tiles, BC_DEM,
       save_output = TRUE,
       overwrite = FALSE,
       output_dir = "temp/DEM_tiles/")
# Create VRT
make_vrt(path = "temp/DEM_tiles/", filename = "temp/BC_DEM_VRT.vrt", overwrite = TRUE)
}