getDEM: Download a digital elevation model for an image

View source: R/water_netRadiation.G.R

getDEMR Documentation

Download a digital elevation model for an image

Description

Downloads the Copernicus DEM GLO-30 (30 m) tiles that cover the image and returns the DEM on the image grid, ready for METRIC.EB(plain = FALSE, DEM = ). The tiles are Cloud Optimized GeoTIFFs in the AWS Open Data registry, read over HTTPS: no account is needed, and only the area of the image is downloaded. It needs an internet connection. To use SRTM tiles already downloaded, see checkSRTMgrids and prepareSRTMdata().

Usage

getDEM(image, source = "copernicus")

Arguments

image

SpatRaster (e.g. the Landsat image) that defines the extent, CRS and grid of the DEM

source

DEM source. Currently only "copernicus" (Copernicus DEM GLO-30) Tiles that do not exist (ocean) are skipped and reported, any other error (e.g. no internet connection) stops, and the share of NA cells is reported.

Value

SpatRaster with one layer named DEM: elevation (m, relative to the EGM2008 geoid) on the grid of image.

Author(s)

Guillermo Federico Olmedo

References

Copernicus DEM GLO-30: (c) DLR e.V. 2010-2014 and (c) Airbus Defence and Space GmbH 2014-2018, provided under COPERNICUS by the European Union and ESA; all rights reserved. Distributed through the Registry of Open Data on AWS, https://registry.opendata.aws/copernicus-dem/

See Also

Other support functions: checkSRTMgrids(), createAoi(), prepareSRTMdata(), waterOptions()

Examples

## Not run: 
image.DN <- rast(L7_Talca)
DEM <- getDEM(image.DN)
plot(DEM)

## End(Not run)

water documentation built on Nov. 25, 2026, 5:08 p.m.