whiteboxing | R Documentation |
Wrapper to tools from "whitebox" package to manipulate with ursaRaster
objects
whiteboxing(tool_name, ...)
tool_name |
Either tool name of Whitebox or function name from whitebox. |
... |
List of parameters. |
Wrapper to function wbt_run_tool
.
ursaRaster
object foo
can be passed via parameter input=foo
instead of GeoTIFF file name.
If argument output
is missed or output=FALSE
, then object of class ursaRaster
. Otherwise, output GeoTIFF file name.
Internally, for piping support, first character argument without *.tif
suffix is interpreted as tool_name
. First unnamed character argument with *.tif
suffix or ursaRaster
object is interpreted as input.
Nikita Platonov platonov@sevin.ru
WhiteboxTools whitebox
if ((requireNamespace("whitebox"))&&(isTRUE(whitebox::wbt_init()))) {
dem <- whitebox::sample_dem_data()
a1 <- c(DEM=read_gdal(dem))
a2 <- whiteboxing("BreachDepressions",input=a1)
b <- list(value=c(a1,a2),difference=c(diff=a1-a2))
print(b)
display(b,layout=c(2,NA),legend=list(list("first","left"),list("last","left")))
if (getRversion()>="4.1.0") {
a5 <- dem |>
whiteboxing("feature_preserving_smoothing",filter=9) |>
whiteboxing("breach_depressions") |>
print()
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.