Spatial Analysis with WhiteboxTools in R

The whitebox R package is built on WhiteboxTools, an advanced geospatial data analysis platform developed by Prof. John Lindsay (webpagejblindsay) at the University of Guelph’s Geomorphometry and Hydrogeomatics Research GroupWhiteboxTools can be used to perform common geographical information systems (GIS) analysis operations, such as cost-distance analysis, distance buffering, and raster reclassification. Remote sensing and image processing tasks include image enhancement (e.g. panchromatic sharpening, contrast adjustments), image mosaicing, numerous filtering operations, simple classification (k-means), and common image transformations. WhiteboxTools also contains advanced tooling for spatial hydrological analysis (e.g. flow-accumulation, watershed delineation, stream network analysis, sink removal), terrain analysis (e.g. common terrain indices such as slope, curvatures, wetness index, hillshading; hypsometric analysis; multi-scale topographic position analysis), and LiDAR data processing. LiDAR point clouds can be interrogated (LidarInfo, LidarHistogram), segmented, tiled and joined, analyzed for outliers, interpolated to rasters (DEMs, intensity images), and ground-points can be classified or filtered. WhiteboxTools is not a cartographic or spatial data visualization package; instead it is meant to serve as an analytical backend for other data visualization software, mainly GIS. Suggested citation: Lindsay, J. B. (2016). Whitebox GAT: A case study in geomorphometric analysis. Computers & Geosciences, 95, 75-84. doi: http://dx.doi.org/10.1016/j.cageo.2016.07.003

Install whiteboxR package

Code
#remove.packages("whitebox")
devtools::install_github("giswqs/whiteboxR")

Installing WhiteboxTools

The quickest way to get started if you are on 64-bit Windows, Linux or MacOS architectures is to download and install the ‘WhiteboxTools’ binary.

A method install_whitebox() is provided to download a version of the binaries that corresponds to the wrapper functions available in the package.

Code
whitebox::install_whitebox()
Performing one-time download of WhiteboxTools binary from
     https://www.whiteboxgeo.com/WBT_Windows/WhiteboxTools_win_amd64.zip 
(This could take a few minutes, please be patient...)
WhiteboxTools binary is located here:  C:/Users/zahmed2/AppData/Roaming/R/data/R/whitebox/WBT/whitebox_tools.exe 
You can now start using whitebox
    library(whitebox)
    wbt_version()
Code
# set up as needed
library(whitebox)
wbt_init()

Further reading

  1. Interfacing With R