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, 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 )
file | Character. Elevation file (see |
---|---|
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. |
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. |
For information regarding loading other file types see
load_file
.
For resuming a run, resume
must be one of
the following:
directions
(Calculating Directions)
watersheds
(Calculating Watersheds)
local
(Initial Pit Removal)
pond
(Calculating Pond Shed Statistics - Second Pit Removal)
fill
(Calculating Fill Shed Statistics - Third Pit Removal)
slope
(Slope Gradient and Curvature values)
idirections
(Calculating Directions on Inverted DEM)
iwatersheds
(Calculating Inverted Watersheds)
inverted
(Inverted Pit Removal)
report
(Create the final report)
# 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.21 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.2 min # Clean up (remove created folder and output) unlink("./testELEV/", recursive = TRUE)