flow_mapper: Map flow through the landscape

Description Usage Arguments Details Examples

View source: R/flow_mapper.R

Description

Run an elevation file through all functions to calculate watershed flow and fill patterns. Based on FlowMapR by R. A. (Bob) MacMillan, LandMapper Environmental Solutions.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
flow_mapper(
  file,
  nrow,
  ncol,
  grid = NULL,
  missing_value = -9999,
  max_area = 10,
  max_depth = 0.5,
  out_folder = NULL,
  out_format = "rds",
  clean = FALSE,
  clim = NULL,
  rlim = NULL,
  resume = NULL,
  log = TRUE,
  report = TRUE,
  verbose = FALSE,
  quiet = FALSE,
  debug = FALSE
)

Arguments

file

Character. Elevation file (see load_file) for supported file types.

nrow

Numeric. Number of rows in dem file (required for dbf files with a single column, but can be automatically assessed from files with x and y coordinates.

ncol

Numeric. Number of columns in dem file (required for dbf files with a single column, but can be automatically assessed from files with x and y coordinates.

grid

Numeric. Grid size in m of the input DEM file

missing_value

Numeric/Character. Symbols which define missing data

max_area

Numeric. Largest area of pits to be removed during initial pit removal

max_depth

Numeric. Largest depth of pits to be removed during initial pit removal

out_folder

Character. Folder in which to store output files. Defaults to folder in the same location and with the same name as the dem file

out_format

Character. What format should the data be output as? "rds" for R data format (default), "csv" for Comma-separated values. This format is used for all subsequent functions (i.e. form_mapper(), facet_mapper() and wepp_mapper().

clean

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

clim

Numeric vector. Column limits if specifying a subset of the dem

rlim

Numeric vector. Row limits if specifying a subset of the dem

resume

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

log

Logical. Create log file recording progress?

report

Logical. Create html report of results?

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 information regarding loading other file types see load_file.

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

  1. directions (Calculating Directions)

  2. watersheds (Calculating Watersheds)

  3. local (Initial Pit Removal)

  4. pond (Calculating Pond Shed Statistics - Second Pit Removal)

  5. fill (Calculating Fill Shed Statistics - Third Pit Removal)

  6. slope (Slope Gradient and Curvature values)

  7. idirections (Calculating Directions on Inverted DEM)

  8. iwatersheds (Calculating Inverted Watersheds)

  9. inverted (Inverted Pit Removal)

  10. report (Create the final report)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Basic Run
flow_mapper(file = system.file("extdata", "testELEV.dbf", package = "LITAP"),
           out_folder = "./testELEV/", nrow = 90, ncol = 90, grid = 1)

# Specify parameters for initial pit removal
flow_mapper(file = system.file("extdata", "testELEV.dbf", package = "LITAP"),
            out_folder = "./testELEV/", nrow = 90, ncol = 90, grid = 1,
            max_area = 5, max_depth = 2)

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

steffilazerte/LITAP documentation built on Feb. 9, 2022, 8:11 a.m.