This function takes backup data frame output from flow_mapper() and calculates form, wetness indices, reflief and stream/crest lengths (among other metrics). Based on FormMapR by R. A. (Bob) MacMillan, LandMapper Environmental Solutions.

form_mapper(
  folder,
  str_val = 10000,
  ridge_val = 10000,
  resume = NULL,
  log = TRUE,
  clean = FALSE,
  verbose = FALSE,
  quiet = FALSE,
  debug = FALSE
)

Arguments

folder

Character. Location of flow_mapper() output

str_val

Numeric. Definition of a stream (number of upslope cells)

ridge_val

Numeric. Definition of a ridge (number of downslope cells)

resume

Character. From which stage should the run be resumed? (see

log

Logical. Create log file recording progress?

clean

Logical. Remove all output files from previous runs in this folder?

verbose

Logical. Output extra progress messages.

quiet

Logical. Suppress all messages.

debug

Logical. If TRUE, output files contain intermediate columns useful for debugging (e.g., 'buffer', 'seqno_buffer', etc.) Default FALSE.

Details

For resuming a run, resume must be one of the following:

  1. weti (Calculating Wetness Indices)

  2. relief (Calculating Relief Derivitives)

  3. length (Calculating Slope Length)

Note that some variables have a version 1 and a version 2 (i.e. qweti1 and qweti2). These reflect variables calculated (1) area based on number of cells vs. (2) area based on actual grid cell area values.

Examples


# First need to run flow_mapper()
flow_mapper(file = system.file("extdata", "testELEV.dbf", package = "LITAP"),
           out_folder = "./testELEV/", nrow = 90, ncol = 90, grid = 5)
#> CALCULATING DIRECTIONS
#> CALCULATING WATERSHEDS
#> REMOVING INITIAL PITS
#> CALCULATING POND (GLOBAL) WATERSHEDS
#> CALCULATING FILL PATTERNS
#> INVERTING DEM
#> CALCULATING INVERTED DIRECTIONS
#> CALCULATING INVERTED WATERSHEDS
#> REMOVING INVERTED PITS
#> CREATING REPORT
#> Run took: 0.21 min

# Now can run form_mapper()
form_mapper(folder = "./testELEV/")
#> SETUP
#> CALCULATING FORM
#> CALCULATING WETNESS INDICES
#> CALCULATING RELIEF DERIVITIVES
#> CALCULATING SLOPE LENGTH
#> MERGING FLOW AND FORM DATA FOR `ALL_POINTS` FILE
#> Error: There are no eligable weti for type dem files

# Clean up (remove all output)
unlink("./testELEV/", recursive = TRUE)