Raster Calculator

Running programmatically

The Raster Calculator enables the user to perform complex mathematical calculation on rasters. The user can build expressions using large variety of arithmetic, logical, trigonometric, etc. functions provided. Up to 4 rasters can be used in a single expression. The expressions are evaluated by the Raster Calculator on the fly and the user is provided with the status of the formula as he/her builds it.

Inputs:

Notes:

Functions and operators

Priority of the operators

Priority Operators
1 AND, OR, XOR
2 ==, !=, <=, >=, <, >
3 +, -
4 *, /
5 ^

NoData Values

Running Programmatically

(Go to TOP)

Parameters

Expression Explanation
Function Name RasterCalculator
<Raster_A> A String representing a raster dataset.
{Raster_B} A String representing a raster dataset.
{Raster_C} A String representing a raster dataset.
{Raster_D} A String representing a raster dataset.
<output raster> A String - the full name of the output raster.
<expression> A String - the expression to be executed.

Running the function

ETSPath used in the table below is the full path to ETSRun.exe (E.G. "C:\Program Files\ETSpatial Techniques\ETSurface\ETSRun.exe")

Language Syntax
Python subprocess.call([ETSPath, "RasterCalculator", "Raster_A", "Raster_B", "Raster_C", "Raster_D", "output raster", "expression"])
.NET using ETSRun.exe StartInfo.FileName = ETSPath
StartInfo.Arguments = "RasterCalculator" "Raster_A" "Raster_B" "Raster_C" "Raster_D" "output raster" "expression"
.NET using ETSOutX.dll RasterCalculator(Raster_A, Raster_B, Raster_C, Raster_D, output raster, expression)
ArcPy arcpy.RasterCalculator("Raster_A", "Raster_B", "Raster_C", "Raster_D", "output raster", "expression")

Notes:

(Go to TOP)