Learn R Programming

ursa (version 3.10.4)

whiteboxing: Wrapper to WhiteboxTools

Description

Wrapper to tools from "whitebox" package to manipulate with ursaRaster objects

Usage

whiteboxing(tool_name, ...)

Value

If argument output is missed or output=FALSE, then object of class ursaRaster. Otherwise, output GeoTIFF file name.

Arguments

tool_name

Either tool name of Whitebox or function name from whitebox.

...

List of parameters.

Author

Nikita Platonov platonov@sevin.ru

Details

Wrapper to function wbt_run_tool.

ursaRaster object foo can be passed via parameter input=foo instead of GeoTIFF file name.

See Also

WhiteboxTools whitebox

Examples

Run this code
if ((requireNamespace("whitebox"))&&(isTRUE(whitebox::wbt_init()))&&
    (requireNamespace("stars"))) {
   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()
   }
}

Run the code above in your browser using DataLab