Learn R Programming

gdalraster (version 1.11.1)

dem_proc: GDAL DEM processing

Description

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.

Usage

dem_proc(
  mode,
  srcfile,
  dstfile,
  mode_options = DEFAULT_DEM_PROC[[mode]],
  color_file = NULL,
  quiet = FALSE
)

Value

Logical indicating success (invisible TRUE). An error is raised if the operation fails.

Arguments

mode

Character. Name of the DEM processing mode. One of hillshade, slope, aspect, color-relief, TRI, TPI or roughness.

srcfile

Filename of the source elevation raster.

dstfile

Filename of the output raster.

mode_options

An optional character vector of command-line options (see DEFAULT_DEM_PROC for default values).

color_file

Filename of a text file containing lines formatted as: "elevation_value red green blue". Only used when mode = "color-relief".

quiet

Logical scalar. If TRUE, a progress bar will not be displayed. Defaults to FALSE.

Examples

Run this code
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