Raster calculator

The raster calculator is a powerful Whitebox GAT application for performing complex mathematic operations and functions involving raster and numerical data. Thus, the Raster Calculator enables the user to perform Map Algebra. Common mathematical, logical, and comparison operators and functions are available for inclusion in expressions. The following is an example of the syntax for a simple mathematical expression:

[output image]=([input1]+[input2])/2

In this example, input1 and input2 are existing images within the current working directory and output image is the name of the images that will be created by the evaluation of the expression. Notice that square brackets are used in the expression to denote image names and that there is no need to specify the directory component of the file name if the image is within the working directory. If an output name is not assigned, one will be automatically assigned and the output image will be created accordingly.

It is possible to enter multiple lines into the Expression box before pressing the Evaluate button.

The Raster Calculator replicates all of the tools within the Mathematical Analysis toolbox, but allows for more complex combinations of operators and functions than would be possible using the standard tools. Scripting using the Whitebox Scripter is an alternative to the Raster Calculator when expressions are complex, involve extensive calling of plugin tools, or involves numerous lines. Scripting is currently available using Python (Jython), Groovy, and JavaScript.

See Also: