powered by
dem_proc() generates DEM derivatives from an input elevation raster. This function is a wrapper for the gdaldem command-line utility. See https://gdal.org/programs/gdaldem.html for details.
dem_proc()
gdaldem
dem_proc( mode, srcfile, dstfile, mode_options = DEFAULT_DEM_PROC[[mode]], color_file = NULL, quiet = FALSE )
Logical indicating success (invisible TRUE). An error is raised if the operation fails.
TRUE
Character. Name of the DEM processing mode. One of hillshade, slope, aspect, color-relief, TRI, TPI or roughness.
Filename of the source elevation raster.
Filename of the output raster.
An optional character vector of command-line options (see DEFAULT_DEM_PROC for default values).
Filename of a text file containing lines formatted as: "elevation_value red green blue". Only used when mode = "color-relief".
mode = "color-relief"
Logical scalar. If TRUE, a progress bar will not be displayed. Defaults to FALSE.
FALSE
elev_file <- system.file("extdata/storml_elev.tif", package="gdalraster") slp_file <- file.path(tempdir(), "storml_slp.tif") dem_proc("slope", elev_file, slp_file) deleteDataset(slp_file)
Run the code above in your browser using DataLab