**WhiteboxTools** R Frontend.

This repository is related to the **whitebox** R package for geospatial analysis, which is an R frontend of a stand-alone executable command-line program called **WhiteboxTools**.

- Authors: Dr. John Lindsay (http://www.uoguelph.ca/~hydrogeo/index.html)
- Contributors: Dr. Qiusheng Wu (https://wetlands.io)
- GitHub repo: https://github.com/giswqs/whiteboxR
- WhiteboxTools: https://github.com/jblindsay/whitebox-tools
- User Manual: https://jblindsay.github.io/wbt_book
- Free software: MIT license

**Contents**

The **whitebox** R package is built on **WhiteboxTools**, an advanced geospatial data analysis platform developed by Prof. John Lindsay (webpage; jblindsay) at the University of Guelph's Geomorphometry and Hydrogeomatics Research Group. *WhiteboxTools* 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, analyized 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:10.1016/j.cageo.2016.07.003.

There are three ways to install the **whitebox** R package.

**whitebox** will be available on CRAN soon. Once it is available on CRAN, you can install it with:

```
install.packages("whitebox")
```

**whitebox** is now available on R-Forge, so you can install it with:

```
install.packages("whitebox", repos="http://R-Forge.R-project.org")
```

You can alternatively install the development version of **whitebox** from GitHub as follows:

```
if (!require(devtools)) install.packages('devtools')
devtools::install_github("giswqs/whiteboxR")
```

Youâ€™ll also need to make sure your machine is able to build packages from source. See Package Development Prerequisites for the tools needed for your operating system.

A complete list of functions available in the **whitebox** R package can be found HERE. Check out this demo for examples.

**About WhiteboxTools?**

```
library(whitebox)
# Prints the whitebox-tools help...a listing of available commands
print(wbt_help())
# Prints the whitebox-tools license
print(wbt_license())
# Prints the whitebox-tools version
print(wbt_version())
# Prints the toolbox for a specific tool.
print(wbt_toolbox())
# List all available tools in whitebox-tools
print(wbt_list_tools())
# Lists tools with 'lidar' in tool name or description.
print(wbt_list_tools("lidar"))
# Prints the help for a specific tool.
print(wbt_tool_help("lidar_info"))
# Retrieves the tool parameter descriptions for a specific tool.
print(wbt_tool_parameters("slope"))
# View the source code for a specific tool on the source code repository.
print(wbt_view_code("breach_depressions"))
```

**How to run tools?**

Tool names in the whitebox R package can be called using the snake_case (e.g. lidar_info). See below for an example. If you are interested in using the WhiteboxTools command-line program, check WhiteboxTools Usage.

```
library(whitebox)
# Set input raster DEM file
dem <- system.file("extdata", "DEM.tif", package="whitebox")
# Run tools
feature_preserving_denoise(dem, "./smoothed.tif", filter=9)
breach_depressions("./smoothed.tif", "./breached.tif")
d_inf_flow_accumulation(dem, "./flow_accum.tif", verbose_mode = FALSE)
```

The **WhiteboxTools** library currently contains more than 396 tools, which are each grouped based on their main function into one of the following categories: Data Tools, GIS Analysis, Hydrological Analysis, Image Analysis, LiDAR Analysis, Mathematical and Statistical Analysis, Stream Network Analysis, and Terrain Analysis. The following is a complete listing of available tools, with brief tool descriptions.

**Data Tools**

: Modifies the attribute table of a point vector by adding fields containing each point's X and Y coordinates.*AddPointCoordinatesToTable*: Converts nodata values in a raster to zero.*ConvertNodataToZero*: Converts raster data from one format to another.*ConvertRasterFormat*: Exports an attribute table to a CSV text file.*ExportTableToCsv*: Merge a vector's attribute table with another table based on a common field.*JoinTables*: Converts vector polylines to polygons.*LinesToPolygons*: Merge a vector's attribute table with a table contained within a CSV text file.*MergeTableWithCsv*: Combines two or more input vectors of the same ShapeType creating a single, new output vector.*MergeVectors*: Converts a vector file containing multi-part features into a vector containing only single-part features.*MultiPartToSinglePart*: Creates a new raster using a base image.*NewRasterFromBase*: Converts vector polygons into polylines.*PolygonsToLines*: Prints the tags within a GeoTIFF.*PrintGeoTiffTags*: Converts a raster lines features into vector of the POLYLINE shapetype.*RasterToVectorLines*: Converts a raster dataset to a vector of the POINT shapetype.*RasterToVectorPoints*: initializes a vector's attribute table deleting all fields but the feature ID (FID).*ReinitializeAttributeTable*: Removes holes within the features of a vector polygon file.*RemovePolygonHoles*: Assign a specified value in an input image to the NoData value.*SetNodataValue*: Converts a vector file containing multi-part features into a vector containing only single-part features.*SinglePartToMultiPart*: Converts a vector containing polylines into a raster.*VectorLinesToRaster*: Converts a vector containing points into a raster.*VectorPointsToRaster*: Converts a vector containing polygons into a raster.*VectorPolygonsToRaster*

**Geomorphometric Analysis**

: Calculates an aspect raster from an input DEM.*Aspect*: Calculates deviation from mean elevation.*DevFromMeanElev*: Calculates difference from mean elevation (equivalent to a high-pass filter).*DiffFromMeanElev*: Calculates relief for cells in an input DEM for a specified direction.*DirectionalRelief*: Reduces short-scale variation in an input DEM while preserving breaks-in-slope and small drainage features using a modified Sun et al. (2007) algorithm.*DrainagePreservingSmoothing*: Calculates the Hjerdt et al. (2004) downslope index.*DownslopeIndex*: Calculate the elevation of each grid cell above the nearest downstream pit cell or grid edge cell.*ElevAbovePit*: Calculates the elevation percentile raster from a DEM.*ElevPercentile*: Calculates the elevation of a location relative to the minimum and maximum elevations in a DEM.*ElevRelativeToMinMax*: Calculates the elevation of a location relative to the minimum and maximum elevations in a watershed.*ElevRelativeToWatershedMinMax*: Reduces short-scale variation in an input DEM using a modified Sun et al. (2007) algorithm.*FeaturePreservingDenoise*: Performs an analysis of fetch or upwind distance to an obstacle.*FetchAnalysis*: Fills nodata holes in a DEM.*FillMissingData*: Identifies potential ridge and peak grid cells.*FindRidges*: Calculates a hillshade raster from an input DEM.*Hillshade*: Calculates horizon angle (maximum upwind slope) for each grid cell in an input DEM.*HorizonAngle*: Calculates a hypsometric curve for one or more DEMs.*HypsometricAnalysis*: Calculates the maximum anisotropy (directionality) in elevation deviation over a range of spatial scales.*MaxAnisotropyDev*: Calculates the anisotropy in deviation from mean for points over a range of spatial scales.*MaxAnisotropyDevSignature*: Lindsay and Seibert's (2013) branch length index is used to map drainage divides or ridge lines.*MaxBranchLength*: Calculates the maximum difference from mean elevation over a range of spatial scales.*MaxDifferenceFromMean*: Calculates the maximum downslope change in elevation between a grid cell and its eight downslope neighbors.*MaxDownslopeElevChange*: Calculates the maximum elevation deviation over a range of spatial scales.*MaxElevationDeviation*: Calculates the maximum elevation deviation over a range of spatial scales and for a set of points.*MaxElevDevSignature*: Calculates the minimum downslope change in elevation between a grid cell and its eight downslope neighbors.*MinDownslopeElevChange*: Calculates surface roughness over a range of spatial scales.*MultiscaleRoughness*: Calculates the surface roughness for points over a range of spatial scales.*MultiscaleRoughnessSignature*: Creates a multiscale topographic position image from three DEVmax rasters of differing spatial scale ranges.*MultiscaleTopographicPositionImage*: Calculates the number of downslope neighbours to each grid cell in a DEM.*NumDownslopeNeighbours*: Calculates the number of upslope neighbours to each grid cell in a DEM.*NumUpslopeNeighbours*: Classifies hillslope zones based on slope, profile curvature, and plan curvature.*PennockLandformClass*: Calculates percent of elevation range from a DEM.*PercentElevRange*: Calculates a plan (contour) curvature raster from an input DEM.*PlanCurvature*: Calculates a profile curvature raster from an input DEM.*ProfileCurvature*: Plots profiles from digital surface models.*Profile*: Calculates relative aspect (relative to a user-specified direction) from an input DEM.*RelativeAspect*: Calculates the relative stream power index.*RelativeStreamPowerIndex*: Calculates the relative topographic position index from a DEM.*RelativeTopographicPosition*: Calculates the Riley et al.'s (1999) terrain ruggedness index from an input DEM.*RuggednessIndex*: Removes off-terrain objects from a raster digital elevation model (DEM).*RemoveOffTerrainObjects*: Calculates the sediment transport index.*SedimentTransportIndex*: Calculates a slope raster from an input DEM.*Slope*: Creates a slope vs. elevation plot for one or more DEMs.*SlopeVsElevationPlot*: Calculates the standard deviation of slope from an input DEM.*StandardDeviationOfSlope*: Calculates a tangential curvature raster from an input DEM.*TangentialCurvature*: Calculates a total curvature raster from an input DEM.*TotalCurvature*: Identifies the viewshed for a point or set of points.*Viewshed*: Estimates the relative visibility of sites in a DEM.*VisibilityIndex*: Calculates the topographic wetness index, Ln(A / tan(slope)).*WetnessIndex*

**GIS Analysis**

: Aggregates a raster to a lower resolution.*AggregateRaster*: Calculates the average for each grid cell from a group of raster images.*AverageOverlay*: Creates a raster grid based on a set of vector points and assigns grid values using a block maximum scheme.*BlockMaximumGridding*: Creates a raster grid based on a set of vector points and assigns grid values using a block minimum scheme.*BlockMinimumGridding*: Maps a distance-based buffer around each non-background (non-zero/non-nodata) grid cell in an input image.*BufferRaster*: Calculates the centroid, or average location, of raster polygon objects.*Centroid*: Identifes the centroid point of a vector polyline or polygon feature or a group of vector points.*CentroidVector*: Extract all the features, or parts of features, that overlap with the features of the clip vector.*Clip*: Clips a raster to a vector polygon.*ClipRasterToPolygon*: Groups cells that form physically discrete areas, assigning them unique identifiers.*Clump*: Calculates the compactness ratio (A/P), a measure of shape complexity, for vector polygons.*CompactnessRatio*: This tool creates a vector triangular irregular network (TIN) for a set of vector points.*ConstructVectorTin*: Counts the number of occurrences of a specified value in a cell-stack of rasters.*CountIf*: Identifies the source cell to which each grid cell is connected by a least-cost pathway in a cost-distance analysis.*CostAllocation*: Performs cost-distance accumulation on a cost surface and a group of source cells.*CostDistance*: Performs cost-distance pathway analysis using a series of destination grid cells.*CostPathway*: Creates an hexagonal vector grid.*CreateHexagonalVectorGrid*: Creates a raster image based on the equation for a simple plane.*CreatePlane*: Creates a rectangular vector grid.*CreateRectangularVectorGrid*: Removes the interior, or shared, boundaries within a vector polygon coverage.*Dissolve*: Calculate the proportion of cells in a raster polygon that are edge cells.*EdgeProportion*: Removes any coincident, or nearly coincident, points from a vector points file.*EliminateCoincidentPoints*: Calculates the elongation ratio for vector polygons.*ElongationRatio*: Removes all the features, or parts of features, that overlap with the features of the erase vector polygon.*Erase*: Erases (cuts out) a vector polygon from a raster.*ErasePolygonFromRaster*: Assigns grid cells in the output raster the value of the nearest target cell in the input image, measured by the Shih and Wu (2004) Euclidean distance transform.*EuclideanAllocation*: Calculates the Shih and Wu (2004) Euclidean distance transform.*EuclideanDistance*: Extends vector lines by a specified distance.*ExtendVectorLines*: Converts vector lines or polygons into vertex points.*ExtractNodes*: Extracts the values of raster(s) at vector point locations.*ExtractRasterValuesAtPoints*: Locates the lowest and/or highest valued cells in a raster.*FindLowestOrHighestPoints*: Finds all cells located on the edge of patch or class features.*FindPatchOrClassEdgeCells*: Identifies the stack position of the maximum value within a raster stack on a cell-by-cell basis.*HighestPosition*: Calculates the proportion of the total area of a polygon's holes relative to the area of the polygon's hull.*HoleProportion*: Interpolates vector points into a raster surface using an inverse-distance weighted scheme.*IdwInterpolation*: Identifies the parts of features in common between two input vector layers.*Intersect*: Creates a vector polygon footprint of the area covered by a raster grid or vector layer.*LayerFootprint*: Calculates the linearity index for vector polygons.*LinearityIndex*: Identifies points where the features of two vector line layers intersect.*LineIntersections*: Identifies the stack position of the minimum value within a raster stack on a cell-by-cell basis.*LowestPosition*: Evaluates the maximum absolute value for each grid cell from a stack of input rasters.*MaxAbsoluteOverlay*: Evaluates the maximum value for each grid cell from a stack of input rasters.*MaxOverlay*: Calculates the medoid for a series of vector features contained in a shapefile.*Medoid*: Evaluates the minimum absolute value for each grid cell from a stack of input rasters.*MinAbsoluteOverlay*: Creates a vector minimum bounding rectangle around vector features.*MinimumBoundingBox*: Delineates the minimum bounding circle (i.e. smallest enclosing circle) for a group of vectors.*MinimumBoundingCircle*: Creates a vector axis-aligned minimum bounding rectangle (envelope) around vector features.*MinimumBoundingEnvelope*: Creates a vector convex polygon around vector features.*MinimumConvexHull*: Evaluates the minimum value for each grid cell from a stack of input rasters.*MinOverlay*: Creates a raster grid based on a set of vector points and assigns grid values using the nearest neighbour.*NearestNeighbourGridding*: Calculates the orientation of vector polygons.*PatchOrientation*: Calculates the percentage of a raster stack that have cell values equal to an input on a cell-by-cell basis.*PercentEqualTo*: Calculates the percentage of a raster stack that have cell values greater than an input on a cell-by-cell basis.*PercentGreaterThan*: Calculates the percentage of a raster stack that have cell values less than an input on a cell-by-cell basis.*PercentLessThan*: Calculates the perimeter-area ratio of vector polygons.*PerimeterAreaRatio*: Outputs the value from a raster stack specified by a position raster.*PickFromList*: Calculates the area of vector polygons.*PolygonArea*: This tool can be used to map the long axis of polygon features.*PolygonLongAxis*: Calculates the perimeter of vector polygons.*PolygonPerimeter*: This tool can be used to map the short axis of polygon features.*PolygonShortAxis*: Creates a polygon layer from two or more intersecting line features contained in one or more input vector line files.*Polygonize*: Calculates the distance of cells from their polygon's centroid.*RadiusOfGyration*: Assign row or column number to cells.*RasterCellAssignment*: Reclassifies the values in a raster image.*Reclass*: Reclassifies the values in a raster image based on equal-ranges.*ReclassEqualInterval*: Reclassifies the values in a raster image using reclass ranges in a text file.*ReclassFromFile*: Calculates the related circumscribing circle of vector polygons.*RelatedCircumscribingCircle*: Calculates overall polygon shape complexity or irregularity.*ShapeComplexityIndex*: Smooths a vector coverage of either a POLYLINE or POLYGON base ShapeType.*SmoothVectors*: Splits the lines or polygons in one layer using the lines in another layer*SplitWithLines*: Calculates the sum for each grid cell from a group of raster images.*SumOverlay*: Outputs the features that occur in one of the two vector inputs but not both, i.e. no overlapping features.*SymmetricalDifference*: Creates a raster grid based on a triangular irregular network (TIN) fitted to vector points.*TINGridding*: Splits vector layers at their overlaps, creating a layer containing all the portions from both input and overlay layers.*Union*: Hex-bins a set of vector points.*VectorHexBinning*: s tool creates a vector Voronoi diagram for a set of vector points.*VoronoiDiagram*: Performs a weighted sum on multiple input rasters after converting each image to a common scale. The tool performs a multi-criteria evaluation (MCE).*WeightedOverlay*: Performs a weighted-sum overlay on multiple input raster images.*WeightedSum*

**Hydrological Analysis**

: measures the average length of all upslope flowpaths draining each grid cell.*AverageFlowpathSlope*: Measures the average length of all upslope flowpaths draining each grid cell.*AverageUpslopeFlowpathLength*: Identifies drainage basins that drain to the DEM edge.*Basins*: Breaches all of the depressions in a DEM using Lindsay's (2016) algorithm. This should be preferred over depression filling in most cases.*BreachDepressions*: Removes single-cell pits from an input DEM by breaching.*BreachSingleCellPits*: Calculates a D8 flow accumulation raster from an input DEM.*D8FlowAccumulation*: Performs a D8 mass flux calculation.*D8MassFlux*: Calculates a D8 flow pointer raster from an input DEM.*D8Pointer*: Measures the depth of sinks (depressions) in a DEM.*DepthInSink*: Calculates a D-infinity flow accumulation raster from an input DEM.*DInfFlowAccumulation*: Performs a D-infinity mass flux calculation.*DInfMassFlux*: Calculates a D-infinity flow pointer (flow direction) raster from an input DEM.*DInfPointer*: Measures distance to the nearest downslope stream cell.*DownslopeDistanceToStream*: Calculates the downslope flowpath length from each cell to basin outlet.*DownslopeFlowpathLength*: Calculates the elevation of cells above the nearest downslope stream cell.*ElevationAboveStream*: Calculates the elevation of cells above the nearest (Euclidean distance) stream cell.*ElevationAboveStreamEuclidean*: Calculates a FD8 flow accumulation raster from an input DEM.*FD8FlowAccumulation*: Calculates an FD8 flow pointer raster from an input DEM.*FD8Pointer*: Burns streams into a DEM using the FillBurn (Saunders, 1999) method.*FillBurn*: Fills all of the depressions in a DEM. Depression breaching should be preferred in most cases.*FillDepressions*: Raises pit cells to the elevation of their lowest neighbour.*FillSingleCellPits*: Finds grid cells with no downslope neighbours.*FindNoFlowCells*: Finds areas of parallel flow in D8 flow direction rasters.*FindParallelFlow*: Flattens lake polygons in a raster DEM.*FlattenLakes*: Assigns each DEM grid cell its order in the sequence of inundations that are encountered during a search starting from the edges, moving inward at increasing elevations.*FloodOrder*: Resolves all of the depressions in a DEM, outputting a breached DEM, an aspect-aligned non-divergent flow pointer, a flow accumulation raster.*FlowAccumulationFullWorkflow*: Calculates the local maximum absolute difference in downslope flowpath length, useful in mapping drainage divides and ridges.*FlowLengthDiff*: Identifies the individual hillslopes draining to each link in a stream network.*Hillslopes*: Calculates the impoundment size resulting from damming a DEM.*ImpoundmentIndex*: Divides a landscape into nearly equal sized drainage basins (i.e. watersheds).*Isobasins*: Moves outlet points used to specify points of interest in a watershedding operation to the nearest stream cell.*JensonSnapPourPoints*: Measures the maximum length of all upslope flowpaths draining each grid cell.*MaxUpslopeFlowpathLength*: Delineates the longest flowpaths for a group of subbasins or watersheds.*LongestFlowpath*: Computes the number of inflowing neighbours to each cell in an input DEM based on the D8 algorithm.*NumInflowingNeighbours*: Raises walls in a DEM along a line or around a polygon, e.g. a watershed.*RaiseWalls*: Calculates a stochastic Rho8 flow pointer raster from an input DEM.*Rho8Pointer*: Identifies the depressions in a DEM, giving each feature a unique identifier.*Sink*: Moves outlet points used to specify points of interest in a watershedding operation to the cell with the highest flow accumulation in its neighbourhood.*SnapPourPoints*: Preforms a stochastic analysis of depressions within a DEM.*StochasticDepressionAnalysis*: Identifies Strahler-order basins from an input stream network.*StrahlerOrderBasins*: Identifies the catchments, or sub-basin, draining to each link in a stream network.*Subbasins*: Traces downslope flowpaths from one or more target sites (i.e. seed points).*TraceDownslopeFlowpaths*: Extract whole watersheds for a set of outlet points.*UnnestBasins*: Identifies the watershed, or drainage basin, draining to a set of target cells.*Watershed*

**Image Analysis**

: Performs an adaptive filter on an image.*AdaptiveFilter*: Performs a balance contrast enhancement on a colour-composite image of multispectral data.*BalanceContrastEnhancement*: A bilateral filter is an edge-preserving smoothing filter introduced by Tomasi and Manduchi (1998).*BilateralFilter*: Performs a change vector analysis on a two-date multi-spectral dataset.*ChangeVectorAnalysis*: A closing is a mathematical morphology operating involving an erosion (min filter) of a dilation (max filter) set.*Closing*: Performs a conservative smoothing filter on an image.*ConservativeSmoothingFilter*: Identifies corner patterns in boolean images using hit-and-miss pattern mattching.*CornerDetection*Corrects the darkening of images towards corners.*CorrectVignetting*: Creates a colour-composite image from three bands of multispectral imagery.*CreateColourComposite*: Performs a direct decorrelation stretch enhancement on a colour-composite image of multispectral data.*DirectDecorrelationStretch*: Performs a Difference of Gaussian (DoG) filter on an image.*DiffOfGaussianFilter*: Assigns each cell in the output grid the number of different values in a moving window centred on each grid cell in the input raster.*DiversityFilter*: Performs a simple edge-preserving mean filter on an input image.*EdgePreservingMeanFilter*: Performs an emboss filter on an image, similar to a hillshade operation.*EmbossFilter*: Performs a fast approximate Gaussian filter on an image.*FastAlmostGaussianFilter*: Reflects an image in the vertical or horizontal axis.*FlipImage*: Performs a sigmoidal contrast stretch on input images.*GammaCorrection*: Performs a Gaussian contrast stretch on input images.*GaussianContrastStretch*: Performs a Gaussian filter on an image.*GaussianFilter*: Performs a high-pass filter on an input image.*HighPassFilter*: Performs a high-pass median filter on an input image.*HighPassMedianFilter*: Performs a histogram equalization contrast enhancement on an image.*HistogramEqualization*: Alters the statistical distribution of a raster image matching it to a specified PDF.*HistogramMatching*: This tool alters the cumulative distribution function of a raster image to that of another image.*HistogramMatchingTwoImages*: Converts intensity, hue, and saturation (IHS) images into red, green, and blue (RGB) images.*IhsToRgb*: Plots an image stack profile (i.e. signature) for a set of points and multispectral images.*ImageStackProfile*: Transforms an input image (summed area table) into its integral image equivalent.*IntegralImage*: Performs a k-means clustering operation on a multi-spectral dataset.*KMeansClustering*: A k-nearest mean filter is a type of edge-preserving smoothing filter.*KNearestMeanFilter*: Performs a Laplacian filter on an image.*LaplacianFilter*: Performs a Laplacian-of-Gaussian (LoG) filter on an image.*LaplacianOfGaussianFilter*: Performs a Lee (Sigma) smoothing filter on an image.*LeeFilter*: Performs a line-detection filter on an image.*LineDetectionFilter*: Performs line thinning a on Boolean raster image; intended to be used with the RemoveSpurs tool.*LineThinning*: Assigns each cell in the output grid the most frequently occurring value (mode) in a moving window centred on each grid cell in the input raster.*MajorityFilter*: Assigns each cell in the output grid the maximum value in a moving window centred on each grid cell in the input raster.*MaximumFilter*: Performs a mean filter (low-pass filter) on an input image.*MeanFilter*: Performs a median filter on an input image.*MedianFilter*: Performs a min-max contrast stretch on an input greytone image.*MinMaxContrastStretch*: Assigns each cell in the output grid the minimum value in a moving window centred on each grid cell in the input raster.*MinimumFilter*: Performs a modified k-means clustering operation on a multi-spectral dataset.*ModifiedKMeansClustering*: Mosaics two or more images together.*Mosaic*: Mosaics two images together using a feathering technique in overlapping areas to reduce edge-effects.*MosaicWithFeathering*: Performs an olympic smoothing filter on an image.*OlympicFilter*: An opening is a mathematical morphology operating involving a dilation (max filter) of an erosion (min filter) set.*Opening*: Calculates the normalized difference vegetation index (NDVI) from near-infrared and red imagery.*NormalizedDifferenceVegetationIndex*: Increases the spatial resolution of image data by combining multispectral bands with panchromatic data.*PanchromaticSharpening*: Performs a percentage linear contrast stretch on input images.*PercentageContrastStretch*: Performs a percentile filter on an input image.*PercentileFilter*: Performs a Prewitt edge-detection filter on an image.*PrewittFilter*: Assigns each cell in the output grid the range of values in a moving window centred on each grid cell in the input raster.*RangeFilter*: Removes the spurs (pruning operation) from a Boolean line image.; intended to be used on the output of the LineThinning tool.*RemoveSpurs*: Resamples one or more input images into a destination image.*Resample*: Converts red, green, and blue (RGB) images into intensity, hue, and saturation (IHS) images.*RgbToIhs*: Performs a Robert's cross edge-detection filter on an image.*RobertsCrossFilter*: Performs a Scharr edge-detection filter on an image.*ScharrFilter*: Performs a sigmoidal contrast stretch on input images.*SigmoidalContrastStretch*: Performs a Sobel edge-detection filter on an image.*SobelFilter*: This tool splits an RGB colour composite image into seperate multispectral images.*SplitColourComposite*: Performs a standard-deviation contrast stretch on input images.*StandardDeviationContrastStretch*: Assigns each cell in the output grid the standard deviation of values in a moving window centred on each grid cell in the input raster.*StandardDeviationFilter*: Thickens single-cell wide lines within a raster image.*ThickenRasterLine*: Performs either a white or black top-hat transform on an input image*TophatTransform*: Performs a total filter on an input image.*TotalFilter*: An image sharpening technique that enhances edges.*UnsharpMasking*: Performs a user-defined weights filter on an image.*UserDefinedWeightsFilter*: Performs a write function memory insertion for single-band multi-date change detection.*WriteFunctionMemoryInsertion*

**LiDAR Analysis**

: Classifies or filters LAS point in regions of overlapping flight lines.*ClassifyOverlapPoints*: Clips a LiDAR point cloud to a vector polygon or polygons.*ClipLidarToPolygon*: Erases (cuts out) a vector polygon or polygons from a LiDAR point cloud.*ErasePolygonFromLidar*: Removes points in a LAS file with scan angles greater than a threshold.*FilterLidarScanAngles*: Identifies points along a flightline's edge in a LAS file.*FindFlightlineEdgePoints*: Reads a LiDAR (LAS) point file and outputs a raster containing the number of overlapping flight lines in each grid cell.*FlightlineOverlap*: Converts one or more LAS files into ASCII text files.*LasToAscii***LasToMultipointShapefile**: Converts one or more LAS files into MultipointZ vector Shapefiles.: Converts one or more LAS files into a vector Shapefile of POINT ShapeType.*LasToShapefile*: Creates a block-maximum raster from an input LAS file.*LidarBlockMaximum*: Creates a block-minimum raster from an input LAS file.*LidarBlockMinimum*: Classifies the values in one LiDAR point cloud that correpond with points in a subset cloud.*LidarClassifySubset*: Adds the red-green-blue colour fields of a LiDAR (LAS) file based on an input image.*LidarColourize*: Creates a vector triangular irregular network (TIN) fitted to LiDAR points.*LidarConstructVectorTIN*: Outputs all of the points within a LiDAR (LAS) point file that lie between a specified elevation range.*LidarElevationSlice*: Identifies ground points within LiDAR dataset.*LidarGroundPointFilter*: Interpolates LAS files using an inverse-distance weighted (IDW) scheme.*LidarIdwInterpolation*: Hex-bins a set of LiDAR points.*LidarHexBinning*: Calculates a hillshade value for points within a LAS file and stores these data in the RGB field.*LidarHillshade*: Creates a histogram from LiDAR data.*LidarHistogram*: Prints information about a LiDAR (LAS) dataset, including header, point return frequency, and classification data and information about the variable length records (VLRs) and geokeys.*LidarInfo*: Joins multiple LiDAR (LAS) files into a single LAS file.*LidarJoin*: Performs a kappa index of agreement (KIA) analysis on the classifications of two LAS files.*LidarKappaIndex*: Grids LAS files using nearest-neighbour scheme.*LidarNearestNeighbourGridding*: Calculates the spatial pattern of point density for a LiDAR data set.*LidarPointDensity*: Creates several rasters summarizing the distribution of LAS point data.*LidarPointStats*: Removes duplicate points from a LiDAR data set.*LidarRemoveDuplicates*: Removes outliers (high and low points) in a LiDAR point cloud.*LidarRemoveOutliers*: Segments a LiDAR point cloud based on normal vectors.*LidarSegmentation*: Identifies ground points within LiDAR point clouds using a segmentation based approach.*LidarSegmentationBasedFilter*: Thins a LiDAR point cloud, reducing point density.*LidarThin*: Thins points from high density areas within a LiDAR point cloud.*LidarThinHighDensity*: Tiles a LiDAR LAS file into multiple LAS files.*LidarTile*: Creates a vector polygon of the convex hull of a LiDAR point cloud.*LidarTileFootprint*: Creates a raster grid based on a triangular irregular network (TIN) fitted to LiDAR points.*LidarTinGridding*: Performs a white top-hat transform on a Lidar dataset; as an estimate of height above ground, this is useful for modelling the vegetation canopy.*LidarTophatTransform*: Calculates normal vectors for points within a LAS file and stores these data (XYZ vector components) in the RGB field.*NormalVectors*: Copies LiDAR tiles overlapping with a polygon into an output directory.*SelectTilesByPolygon*

**Mathematical and Statistical Analysis**

: Calculates the absolute value of every cell in a raster.*AbsoluteValue*: Performs an addition operation on two rasters or a raster and a constant value.*Add*: Performs a logical AND operator on two Boolean raster images.*And*: Performs an analysis of variance (ANOVA) test on a raster dataset.*Anova*: Returns the inverse cosine (arccos) of each values in a raster.*ArcCos*: Returns the inverse sine (arcsin) of each values in a raster.*ArcSin*: Returns the inverse tangent (arctan) of each values in a raster.*ArcTan*: Returns the 2-argument inverse tangent (atan2).*Atan2*: Performs a correlation analysis on attribute fields from a vector database.*AttributeCorrelation*: Creates a histogram for the field values of a vector's attribute table.*AttributeHistogram*: Creates a scattergram for two field values of a vector's attribute table.*AttributeScattergram*: Returns the smallest (closest to negative infinity) value that is greater than or equal to the values in a raster.*Ceil*: Returns the cosine (cos) of each values in a raster.*Cos*: Returns the hyperbolic cosine (cosh) of each values in a raster.*Cosh*: Calculates the Crispness Index, which is used to quantify how crisp (or conversely how fuzzy) a probability image is.*CrispnessIndex*: Performs a cross-tabulation on two categorical images.*CrossTabulation*: Converts a raster image to its cumulative distribution function.*CumulativeDistribution*: Decreases the values of each grid cell in an input raster by 1.0.*Decrement*: Performs a division operation on two rasters or a raster and a constant value.*Divide*: Performs a equal-to comparison operation on two rasters or a raster and a constant value.*EqualTo*: Returns the exponential (base e) of values in a raster.*Exp*: Returns the exponential (base 2) of values in a raster.*Exp2*: Extracts descriptive statistics for a group of patches in a raster.*ExtractRasterStatistics*: Returns the largest (closest to positive infinity) value that is greater than or equal to the values in a raster.*Floor*: Performs a greater-than comparison operation on two rasters or a raster and a constant value.*GreaterThan*: Performs Moran's I analysis on two or more input images.*ImageAutocorrelation*: Performs image correlation on two or more input images.*ImageCorrelation*: Performs image regression analysis on two input images.*ImageRegression*: Increases the values of each grid cell in an input raster by 1.0.*Increment*: Performs an in-place addition operation (input1 += input2).*InPlaceAdd*: Performs an in-place division operation (input1 /= input2).*InPlaceDivide*: Performs an in-place multiplication operation (input1 *= input2).*InPlaceMultiply*: Performs an in-place subtraction operation (input1 -= input2).*InPlaceSubtract*: Performs an integer division operation on two rasters or a raster and a constant value.*IntegerDivision*: Identifies NoData valued pixels in an image.*IsNoData*: Performs a kappa index of agreement (KIA) analysis on two categorical raster files.*KappaIndex*: Evaluates whether the values in a raster are normally distributed.*KSTestForNormality*: Performs a less-than comparison operation on two rasters or a raster and a constant value.*LessThan*: Lists the unique values contained in a field witin a vector's attribute table.*ListUniqueValues*: Returns the base-10 logarithm of values in a raster.*Log10*: Returns the base-2 logarithm of values in a raster.*Log2*: Returns the natural logarithm of values in a raster.*Ln*: Performs a MAX operation on two rasters or a raster and a constant value.*Max*: Performs a MIN operation on two rasters or a raster and a constant value.*Min*: Performs a modulo operation on two rasters or a raster and a constant value.*Modulo*: Performs a multiplication operation on two rasters or a raster and a constant value.*Multiply*: Changes the sign of values in a raster or the 0-1 values of a Boolean raster.*Negate*: Performs a logical NOT operator on two Boolean raster images.*Not*: Performs a not-equal-to comparison operation on two rasters or a raster and a constant value.*NotEqualTo*: Performs a logical OR operator on two Boolean raster images.*Or*: Raises the values in grid cells of one rasters, or a constant value, by values in another raster or constant value.*Power*: Performs a principal component analysis (PCA) on a multi-spectral dataset.*PrincipalComponentAnalysis*: Transforms raster values into quantiles.*Quantiles*: Creates an image containing random values.*RandomField*: Creates an image containing randomly located sample grid cells with unique IDs.*RandomSample*: Creates a histogram from raster values.*RasterHistogram*: Measures a rasters average, standard deviation, num. non-nodata cells, and total.*RasterSummaryStats*: Returns the reciprocal (i.e. 1 / z) of values in a raster.*Reciprocal*: Performs a min-max contrast stretch on an input greytone image.*RescaleValueRange*: Calculates the RMSE and other accuracy statistics.*RootMeanSquareError*: Rounds the values in an input raster to the nearest integer value.*Round*: Returns the sine (sin) of each values in a raster.*Sin*: Returns the hyperbolic sine (sinh) of each values in a raster.*Sinh*: Squares the values in a raster.*Square*: Returns the square root of the values in a raster.*SquareRoot*: Performs a subtraction operation on two rasters or a raster and a constant value.*Subtract*: Returns the tangent (tan) of each values in a raster.*Tan*: Returns the hyperbolic tangent (tanh) of each values in a raster.*Tanh*: Converts a raster from radians to degrees.*ToDegrees*: Converts a raster from degrees to radians.*ToRadians*: Estimates the trend surface of an input raster file.*TrendSurface*: Estimates a trend surface from vector points.*TrendSurfaceVectorPoints*: Truncates the values in a raster to the desired number of decimal places.*Truncate*: Creates an image containing random values based on a turning-bands simulation.*TurningBandsSimulation*: Performs a logical XOR operator on two Boolean raster images.*Xor*: Standardizes the values in an input raster by converting to z-scores.*ZScores*

**Stream Network Analysis**

: Calculates the distance of stream grid cells to the channel network outlet cell.*DistanceToOutlet*: Extracts stream grid cells from a flow accumulation raster.*ExtractStreams*: Identifies potential valley bottom grid cells based on local topolography alone.*ExtractValleys*: Calculates the distance to the furthest upstream channel head for each stream cell.*FarthestChannelHead*: Finds the main stem, based on stream lengths, of each stream network.*FindMainStem*: Assigns the Hack stream order to each link in a stream network.*HackStreamOrder*: Assigns the Horton stream order to each link in a stream network.*HortonStreamOrder*: Calculates the total length of channels upstream.*LengthOfUpstreamChannels*: Plots the stream longitudinal profiles for one or more rivers.*LongProfile*: Plots the longitudinal profiles from flow-paths initiating from a set of vector points.*LongProfileFromPoints*: Rasterizes vector streams based on Lindsay (2016) method.*RasterizeStreams*: Converts a raster stream file into a vector file.*RasterStreamsToVector*: Removes short first-order streams from a stream network.*RemoveShortStreams*: Assigns the Shreve stream magnitude to each link in a stream network.*ShreveStreamMagnitude*: Assigns the Strahler stream order to each link in a stream network.*StrahlerStreamOrder*: Identifies the exterior/interior links and nodes in a stream network.*StreamLinkClass*: Assigns a unique identifier to each link in a stream network.*StreamLinkIdentifier*: Estimates the length of each link (or tributary) in a stream network.*StreamLinkLength*: Estimates the average slope of each link (or tributary) in a stream network.*StreamLinkSlope*: Estimates the slope of each grid cell in a stream network.*StreamSlopeContinuous*: Assigns each link in a stream network its topological order.*TopologicalStreamOrder*: Assigns a unique identifier to each tributary in a stream network.*TributaryIdentifier*

If you would like to contribute to the project as a developer, follow these instructions to get started:

- Fork the whiteboxR repository (https://github.com/giswqs/whiteboxR)
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request

Unless explicitly stated otherwise, any contribution intentionally submitted for inclusion in the work shall be licensed as the MIT license without any additional terms or conditions.

The **WhiteboxR** package is distributed under the MIT license, a permissive open-source (free software) license.

whiteboxR is distributed as is and without warranty of suitability for application. If you encounter flaws with the software (i.e. bugs) please report the issue. Providing a detailed description of the conditions under which the bug occurred will help to identify the bug. *Use the Issues tracker on GitHub to report issues with the software and to request feature enchancements.* Please do not email Dr. Lindsay directly with bugs.

**Any scripts or data that you put into this service are public.**

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.