Skip to contents

D8 Contributing Area

Usage

taudem_aread8(
  input_d8flowdir_grid,
  output_contributing_area_grid = NULL,
  check_edge_contamination = TRUE,
  n_processes = getOption("traudem.n_processes", 1),
  wg_file = NULL,
  outlet_file = NULL,
  outlet_layer_name = NULL,
  outlet_layer_number = NULL,
  quiet = getOption("traudem.quiet", FALSE)
)

Arguments

input_d8flowdir_grid

Input flow directions grid.

output_contributing_area_grid

Output contributing area grid.

check_edge_contamination

Whether to check for edge contamination.

n_processes

Number of processes for mpiexec. If NULL TauDEM is called without mpiexec.

wg_file

Input weight grid (optional).

outlet_file

Input outlets file (OGR readable dataset, optional).

outlet_layer_name

OGR layer name if outlets are not the first layer in outlet_file (optional). Layer name and layer number should not both be specified.

outlet_layer_number

OGR layer number if outlets are not the first layer in outlet_file (optional). Layer name and layer number should not both be specified.

quiet

If FALSE output from TauDEM CLI is suppressed.

Value

Path to output file (invisibly).

Examples

if (FALSE) { # interactive() && traudem::can_register_taudem()
test_dir <- withr::local_tempdir()
dir.create(test_dir)
 file.copy(
   system.file("test-data", "DEM.tif", package = "traudem"),
   file.path(test_dir, "DEM.tif")
 )

filled_pit <- taudem_pitremove(file.path(test_dir, "DEM.tif"))
outputs <- taudem_d8flowdir(filled_pit)
outputs
contributing_area_grid <- taudem_aread8(outputs$output_d8flowdir_grid)
contributing_area_grid
}