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.

flow_mapper(
  file,
  nrow,
  ncol,
  grid = NULL,
  min_x = 1,
  min_y = 1,
  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,
  pitr_method = "landmapr",
  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

min_x

Numeric. Starting x coordinate (in meters)

min_y

Numeric. Starting y coordinate (in meters)

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?

pitr_method

Character. Either "landmapr" or "litap" to define whether to use the LandMapR method for finding a pour point during the pit removal stage (default) or LITAP. The LITAP method defines the pourpoint as the lowest neighbour. The LandMapR defines it as the last possible pour point among neighbouring cells (not necessarily the lowest neighbouring cell).

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

# Basic Run
flow_mapper(file = system.file("extdata", "testELEV.dbf", package = "LITAP"),
           out_folder = "./testELEV/", nrow = 90, ncol = 90, grid = 1)
#> 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.27 min

# 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)
#> 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.22 min

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