Reclass (user-defined classes)

This tool creates a new raster in which the value of each grid cell is determined by an input raster and a collection of user-defined classes. You must specify the New Value, the From value, and the To Just Less Than value. Classes must be mutually exclusive, i.e. non-overlapping.

If the From value is left blank, Reclass will operate in assign mode. That is, any cell in the input image that is equal to the From value will be assigned the New Value in the output image.

Any values in the input raster that do not fall within one of the classes will be assigned its original value in the output raster. NoData values in the input raster will be assigned NoData values in the output raster, unless NoData is used in one of the user-defined reclass ranges (notice that it is valid to enter 'NoData' in these ranges). The output raster is always of a float data type.

See Also:

Scripting:

The following is an example of a Python script that uses this tool:

wd = pluginHost.getWorkingDirectory()
inputFile = wd + "input.dep"
outputFile = wd + "output.dep"
# New Value; From Value; To Just Less Than Value; ...
relassString = "1;0;100;2;100;200;3;200;300;4;300;400"
args = [inputFile, outputFile, relassString]
pluginHost.runPlugin("Reclass", args, False)

This is a Groovy script also using this tool:

def wd = pluginHost.getWorkingDirectory()
def inputFile = wd + "input.dep"
def outputFile = wd + "output.dep"
// New Value; From Value; To Just Less Than Value; ...
def relassString = "1;0;100;2;100;200;3;200;300;4;300;400"
String[] args = [inputFile, outputFile, relassString]
pluginHost.runPlugin("Reclass", args, false)

Credits: