View source: R/ch_wbt_removesinks.R
ch_wbt_removesinks | R Documentation |
Sinks are removed from a DEM using one of several methods. The raster file
types supported are listed in Spatial_hydrology_functions
.
ch_wbt_removesinks( in_dem, out_dem, method = "breach_leastcost", dist = NULL, fn_dem_fsc = NULL, ... )
in_dem |
File path for original dem. Required. |
out_dem |
File path for dem after removing sinks. |
method |
Method for removing sinks. Default method is breach_leastcost. Other methods include breach, fill, fill_pd (Planchon and Darboux), and fill_wl (Wang and Liu). |
dist |
Maximum search distance for breach paths in cells. Required if |
fn_dem_fsc |
File path for dem after removing single-cell pits. |
... |
Additional arguments to be passed to functions to remove sinks. |
Returns a raster object containing the processed dem.
Dan Moore
# Not tested automatically as requires installation of Whitebox ch_wbt_check_whitebox() library(raster) test_raster <- ch_volcano_raster() dem_raster_file <- tempfile(fileext = c(".tif")) no_sink_raster_file <- tempfile("no_sinks", fileext = c(".tif")) # write test raster to file writeRaster(test_raster, dem_raster_file, format = "GTiff") # remove sinks removed_sinks <- ch_wbt_removesinks(dem_raster_file, no_sink_raster_file, method = "fill")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.