elev_deriv: Elevation Derivatives

View source: R/surface_metrics.R

elev_derivR Documentation

Elevation Derivatives

Description

Provide SpatRasters of elevation derivatives. Elev_deriv operates in one of three modes, depending on the input arguments:

  1. As a wrapper for the Fortran makegrids executable, with an existing makegrids input_file.

  2. As a wrapper for makegrids, but with the makegrids input file constructed by elev_deriv.test

  3. To read existing raster files from disk.

In modes 1 and 2, elev_deriv calls makegrids which creates the requested rasters and writes them to disk as floating point binary files. These are then read and returned by elev_deriv as a SpatRaster object. In mode 3, existing raster files are read directly from disk and returned as a SpatRaster object.

Usage

elev_deriv(
  input_file = "nofile",
  rasters = vector("list", 0),
  dem = "none",
  length_scale = 0,
  scratch_dir = "none"
)

Arguments

input_file:

Character string; a makegrids input file (optional). If no input file is specified and no other arguments are present, a Windows Explorer window opens for file selection.

rasters:

A character vector. Each element contains two strings separated by a comma. The first specifies the type of derivative, the second specifies the file name. These may be either input files to read or output files to write. Available elevation derivatives are:

  1. GRADIENT

  2. PLAN CURVATURE

  3. PROFILE CURVATURE

  4. NORMAL SLOPE CURVATURE

  5. TANGENTIAL CURVATURE

  6. MEAN CURVATURE (Normal + Tangential)*0.5

length_scale:

A numeric (dbl) value specifying the diameter in meters over which to measure the requested derivatives. Used for construction of a makegrids input file.

dem:

The file name (full path) of the dem (elevation raster) for construction of a makegrids input file.

scratch_dir:

A scratch directory where temporary files are written. If a makegrids input file is created, it is written here.

Value

SpatRaster (see terra), one layer for each requested elevation derivative.


tabrasel/WetlandTools documentation built on Dec. 20, 2024, 8:50 a.m.