View source: R/ch_wbt_catchment_onestep.R
ch_wbt_catchment_onestep | R Documentation |
Calls all of the ch_wbt
and other functions required to do the sub-tasks
required to delineate a catchment. The names of files to be created
are taken from the list created by the function ch_wbt_filenames
.
ch_wbt_catchment_onestep( wd, in_dem, pp_sf, sink_method = "breach_leastcost", dist = NULL, check_catchment = TRUE, threshold = NULL, snap_dist = NULL, cb_colour = "red", pp_colour = "red", channel_colour = "blue", contour_colour = "grey", plot_na = TRUE, plot_scale = TRUE, na_location = "tr", scale_location = "bl", ... )
wd |
Name of working directory. |
in_dem |
File name for original DEM. |
pp_sf |
Vector containing pour points. |
sink_method |
Method for sink removal as used by |
dist |
Maximum search distance for breach paths in cells. Required if |
check_catchment |
If |
threshold |
Threshold for channel initiation. |
snap_dist |
Maximum pour point snap distance in map units. |
cb_colour |
Colour for catchment outline. Default is "red". |
pp_colour |
Colour for catchment pour points. Default is "red". |
channel_colour |
Colour for channel. Default is "blue". |
contour_colour |
Colour for contours Default is "grey". |
plot_na |
If |
plot_scale |
If |
na_location |
Location for the north arrow. Default is tr, i.e. top-right. |
scale_location |
Location for the scale bar. Default is bl, i.e. bottom-left. |
... |
Extra parameters for |
Returns an sp object of the delineated catchment.
Dan Moore and Kevin Shook
ch_wbt_filenames
# Not tested automatically as requires installation of Whitebox library(raster) test_raster <- ch_volcano_raster() dem_raster_file <- tempfile(fileext = c(".tif")) # write test raster to file writeRaster(test_raster, dem_raster_file, format = "GTiff") wd <- tempdir() pourpoint_file <- tempfile("volcano_pourpoints", fileext = ".shp") pourpoints <- ch_volcano_pourpoints(pourpoint_file) catchment <- ch_wbt_catchment_onestep(wd = wd, in_dem = dem_raster_file, pp_sf = pourpoints, sink_method = "fill", threshold = 1, snap_dist = 10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.