Whitebox Workflows for Python

geoprocessing with Whitebox Workflows for Python

What is Whitebox Workflows?

Whitebox Workflows (WbW) is a Python library for advanced geoprocessing, including more than 400 functions for GIS and remote sensing analysis operations and for for manipulating geospatial data (raster, vector, and LiDAR). WbW enables you to write more powerful geoprocessing scripts than previously possible. WbW provides a more powerful and natural Python-Whitebox interaction. Interacting directly with data also significantly decreases the number of read/write operations during intermediate processing, improving performance of complex workflows and reducing wear and tear on your expensive system hardware. WbW also has an improved memory model for raster data. With WbW, rasters are stored in memory using their native data type, rather than always using large 64-bit floats. Install WbW today and start your automatic free trial now. Install with pip install whitebox-workflows.

I think anybody who starts doing some scripting with Whitebox Workflows will see that the individual tool runtimes are much faster than the total script due to the reading and saving of data. And the code is easier to write too! …I see no downside so far!
Matt Chaney, PE
Water Resources Engineer, AECOM

How does Whitebox Workflows compare?

Whitebox Workflows (WbW) is based on the WhiteboxTools Open Core (WbOC) open-source codebase. While the two products share many characteristics and functionality, there are important differences.

Whitebox Workflows
for Python
WhiteboxTools
Open Core
Whitebox Workflows (WbW) is a native python extension library, which allows a much more intimate level of communication between WbW and you Python geoprocessing script.
Command line back-end program that interfaces with various front ends such as QGIS, ArcGIS and the R and Python programming languages.
With WbW you can directly manipulate raster, vector and lidar data objects, enabling a level of geoprocessing power that would be impossible with WbTOC.
You cannot manipulate geospatial data directly from Python using the WbTOC.
WbW take in-memory geospatial objects as input parameters and also return output objects. There is significantly less reading/writing operations of data to the disc. This allows for faster geoprocessing and less wear on your valuable hard-drives.
Data files are provided as file names and read into memory during tool operation and output data are written to disc.
Uses a more natural in-line Python-based map algebra for rasters analysis.
Raster calculator tool is used for complex raster map algebra.
Proprietary license; available for only $10/seat per year.
Open-source license and freely available.

Geoprocessing with Whitebox Workflows for Python

Data manipulation

Each of the more than 400 geoprocessing tools that users love about the WbOC are also found in WbW. The library design of WbW affords a much more intimate level of communication between it and your Python geoprocessing script. For instance, with WbW you can directly manipulate raster, vector, and lidar data objects, to perform low-level geoprocessing in a way that is impossible with the open-core. For example, to the right we manipulate raster data directly in Python using WbW.

geoprocessing with Whitebox Workflows for Python
geoprocessing with Whitebox Workflows for Python

No intermediate read/write operations

WbW equivalent functions take in-memory geospatial objects as input parameters. WbW functions also return output objects. This means that for a typical geoprocessing workflow there is significantly less reading/writing of data to the disc. There is no performance cost incurred by read/write operations during the intermediate processing. WbW has been designed to meet enterprise-scale geoprocessing workflow needs.
 
The following example Python script interpolates a lidar file to a digital elevation model (DEM), performs some common pre-processing steps on the DEM, and then runs a flow accumulation operation, before outputting the flow accumulation grid to file.

Notice how each of the five tool functions return data objects that then serve as the inputs for later operations. While there’s only one read operation and one write operation in the script, an equivalent WbOC workflow would result in 10 individual read/write operations. This characteristic can result in significant gains in overall workflow performance. It is often the case that read/write operations can be the bottle-neck in geoprocessing performance. Fewer read/write operations also means significantly less wear on your hardware.

Python is your raster calculator

The design of WbW also allows for more natural geoprocessing of data objects. For example, rather than using individual raster math tools (e.g. Add, Divide, Sin etc.), or a raster calculator tool, with WbW, you can often treat raster objects like any other numerical variables in scripts. With WbW, Python becomes your raster calculator! This allows for exceedingly powerful yet expressive GIS scripting.

The WbW User Manual documents each of the mathematical functions that can be applied to raster objects and their parameters.

Raster calc geoprocessing

Time to switch to Workflows

Overall, if you’re using the Whitebox platform to develop Python scripts for geoprocessing tasks, Whitebox Workflows is the clear winner. It provides easier-to-write and faster-running scripting with less strain on your expensive hardware. Simply put, it’s a more productive geoprocessing environment.
 
You need to purchase a valid license activation code to use WbW. We know that you’d rather it was freely available, like WhiteboxTools is. However, there were costs associated with developing this amazing product. The good news is, annual licenses for WbW are as cheap as we could possibly make them, only $10.

Purchase Whitebox Workflows for Python

An annual license for Whitebox Workflows for Python costs US$10 per user*, plus applicable taxes. Choose the number of users that you require and then press 'Purchase now'. Immediately after purchase, you will be redirected to a website that will provide you with your activation key and instructions on how to register your license. Currently WbW is supported on 64-bit Windows, Mac (Intel and ARM), and Linux (x86_64).

How many users do you require at $10/user?


Payments processed and secured by Stripe. All major credit cards are accepted. Prices in US dollars (USD).

*Multiple users may not share a license and require multiple licenses. Licenses are floating and can be used on computers, or in computing environments, other than the one used to register the license using the floating-license user ID, which will be emailed to users upon license registration. All updates throughout the period of the license are free.

Sign up for the Whitebox newsletter






Installation

If you have Python installed on your machine, simply type pip install whitebox-workflows at the command prompt. If you have installed whitebox-workflows Python package already and want to upgrade to the latest version, you can use pip install whitebox-workflows -U to update. It is recommended that you use a Python virtual environment to test the whitebox-workflows package.

After installing WbW and running your first script using the library, you will be provided with a free 3-day trial license. After that point, you will need to purchase (see above) and register an annual license to continue to use the library.

Whitebox Workflows for Python
User Manual

The User Manual contains everything you need to know to get started using Whitebox Workflows for Python for advanced geoprocessing.
We also have released some instructional videos on our YouTube channel. Watch John Lindsay use Whitebox Workflows to write an image filter script in this YouTube video.