prepareSRTMdata: Create a DEM mosaic from SRTM grids for the image extent

View source: R/water_netRadiation.G.R

prepareSRTMdataR Documentation

Create a DEM mosaic from SRTM grids for the image extent

Description

Mosaics the SRTM 1 arc-second tiles found in path (see checkSRTMgrids) and projects the result to the grid of the image.

Usage

prepareSRTMdata(path = getwd(), format = "tif", extent)

Arguments

path

folder where SRTM files are stored

format

file extension of the SRTM grid files (default "tif"); files must be named like s34_w069_1arc_v3.tif

extent

SpatRaster (e.g. the Landsat image) whose grid is used for the output DEM, or an sf / SpatVector polygon with a CRS, in which case a 30 m grid in that CRS is used

Value

SpatRaster with one layer named DEM (m), on the grid defined by extent.

Author(s)

Guillermo Federico Olmedo

See Also

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

Examples

image.DN <- terra::rast(L7_Talca)
# tiles needed to cover the image (to download from EarthExplorer)
checkSRTMgrids(image.DN)
## Not run: 
# with the tiles in a folder: mosaic and crop them to the grid of the image
DEM <- prepareSRTMdata(path = "folder/with/the/SRTM/tiles", extent = image.DN)

## End(Not run)

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