Raster Calculator

ToolBox Implementation .NET Implementation

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:

Output:

Functions and operators:

Priority of the operators

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

NoData Values

ToolBox implementation

Command line syntax

ETS_GPRasterCalculator  <Raster_A> {Raster_B} {Raster_C} {Raster_D} <out_raster>,<Expression>

Parameters

Expression Explanation
<Raster_A> A Raster dataset or Raster layer
{Raster_B} A Raster dataset or Raster layer
{Raster_C} A Raster dataset or Raster layer
{Raster_D} A Raster dataset or Raster layer
<out_raster> A String - the full name of the output raster (Araster with the same full name should not exist)
 <Expression> A String - the expression to be executed

Example: ETS_GPRasterCalculator  elev1 # # # c:\test\output.img IF(A > 1300, NoData, A)

Scripting syntax

ETS_GPRasterCalculator  (Raster_A, Raster_B, Raster_C, Raster_D, out_raster, expression)

See the explanations above:
<> - required parameter
{} - optional parameter

.NET implementation
(Go to TOP)

RasterCalculator (rasterDatasetA As IRasterDataset2, rasterDatasetB As IRasterDataset2, rasterDatasetC As IRasterDataset2, rasterDatasetD As IRasterDataset2, sOutRaster As String, sExpression As String) As IRasterDataset2

The Raster Calculator uses the free MuParser © Ingo Berg (see license).

Copyright © Ianko Tchoukanski