Skip to contents

Download a raster of elevation that matches the shape, resolution and projection of an input raster.

Usage

get_elev_from_raster(r, z, verbose = FALSE)

Arguments

r

A terra::rast specifying the domain to download data for.

z

The zoom level download elevation data at ranging from 1 - 14. One if coarser resolution, 14 is finer resolution. For more information, look at ?elevatr::get_elev_raster

verbose

Whether to display all messages when getting elevation data. Defaults to FALSE.

Value

terra::rast of elevation in m for the input domain

Examples

if (FALSE) {
# test
r <- terra::rast(rh)[[1]]
elev <- get_elev_from_raster(r, 9)
terra::plot(elev)
}