Reclass from ASCII text file

This tool creates a new raster image in which the value of each grid cell is determined by the values in an input raster image and a reclass file. The reclass file is a text file containing two or three columns, delimited (i.e. separated) by either a space, tab, or comma. The columns describe respectively the New Value, the From value, and the To Just Less Than value. Classes must be mutually exclusive, i.e. non-overlapping.

If only two columns are present in the reclass file, i.e. the From column is left blank, the tool will operate in assign mode. That is, any cell in the input image that is equal to the From value (contained in the second column) will be assigned the New Value (contained in the first column) 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. The output raster is always of a float data type. NoData values in the input raster will be assigned NoData values in the output raster.

See Also:


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

wd = pluginHost.getWorkingDirectory()
inputFile = wd + "input.dep"
outputFile = wd + "output.dep"
inputTextFile = wd + "reclass.txt"
args = [inputFile, outputFile,inputTextFile]
pluginHost.runPlugin("ReclassFromFile", 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"
def inputTextFile = wd + "reclass.txt"
String[] args = [inputFile, outputFile, inputTextFile]
pluginHost.runPlugin("ReclassFromFile", args, false)