Available with Spatial Analyst license.
The reclassification tools enable you to quickly and easily reclassify your data using remap or reclassification tables. The format of this table allows the mapping of individual values, ranges of values, strings, or NoData to another value, or NoData. Geoprocessing tools that utilize remap tables are the Reclass By ASCII File and the Reclass By Table tools. If you use the Reclassify tool, you can dynamically create reclassification tables for analysis and optionally save a table for later use. The following sections explain the rules for creating these remap tables and give examples of their use in the reclassification tools.
About remap tables
Remap tables can be ASCII files, geodatabase tables, or INFO tables. ASCII files are required for the Reclass by ASCII File tool and Reclass by Table requires tabular formats. Remap tables consist of two parts. The first part identifies the particular cell value to reclassify and the second part is the cell's reclassified output value.
ASCII remap tables
The ASCII table allows greater flexibility in determining the reclassified values. The table can be created with any text editor using the formatting rules discussed in the following paragraphs to define the parameters for reclassification.
A very basic example of an ASCII remap table follows using only break values to classify a raster.
Value Symbol 3 1 5 2 10 3 15 4
- In this example:
- Cells with a value less than or equal to 3 are assigned symbol 1.
- Cells with a value greater than 3 and less than or equal to 5 are assigned symbol 2.
- Cells with a value greater than 5 and less than or equal to 10 are assigned symbol 3.
- Cells with a value greater than 10 and less than or equal to 15 are assigned symbol 4.
- Cells with a value greater than 15 are assigned NoData.
The ASCII remap table is made up of optional comments, optional keywords, and required assignment statements. Each statement must be on a separate line. Comments are descriptive text that can be used to provide additional information. Comments can appear anywhere in the remap table but must be preceded by the pound sign (#). The keywords establish the parameters in which the reclassification operates. The assignment statements assign an output value to a specified input cell value or range of values.
The keywords are positioned at the beginning of the file before any assignment statements are entered. Comments, however, can be anywhere and may precede the keywords. There are two optional keywords that can be included in the lookup table. The first is LOWEST-INPUT, which identifies the lowest cell value in a raster to consider for reclassification. LOWEST-INPUT is formatted as follows: lowest-input <value>, where <value> is the minimum cell value to consider for reclassification. LOWEST-INPUT is used when you want to exclude cells with values below the specified value. For example, in a raster with cell values ranging from 1 to 20, setting LOWEST-INPUT to 5 excludes those cells with a value less than 5. If not specified, LOWEST-INPUT defaults to the minimum value in the input raster.
The second optional keyword, LOWEST-OUTPUT, identifies the lowest output value or starting point for the reclassified values. This keyword is used to set the output reclassified values automatically for cases in which the assignment statements (described later in this section) specify only as input value; LOWEST-OUTPUT is formatted as lowest-output <value>, where <value> is the lowest output reclassified value. If not specified, LOWEST-OUTPUT defaults to 1.
The assignment statements follow the keywords. They can be formatted using several methods. The general form of an assignment statement establishes the relationship between an input cell value and its reclassified value:
old input cell value : new output reclassified value
The input cell value can be an integer or a real number; however, the output reclassified value can only be an integer.
Several methods can be used to specify an input value and its associated reclassified value. These methods are best presented with examples. The remaining discussion on ASCII remap tables presents several remap tables and describes how the input cell values are reclassified according to the table. All examples use a raster dataset with cell values from 1 to 20.
Examples
Only input cell values identified
This example shows a remap table with assignment statements that contain only an input cell value.
# Example 1 # Remap table for cell value reclassification. LOWEST-INPUT 3 LOWEST-OUTPUT 2 5 6 7 15
Input cell values must always be sorted in ascending order.
As with an INFO remap table, the successive assignment statements implicitly define ranges of cell values for reclassification. Thus, it is essential that the input cell values be sorted in ascending order. The output reclassified value for each range is automatically calculated from the value specified with LOWEST-OUTPUT. The first range of cell values is reclassified to the value specified for LOWEST-OUTPUT. The next range is reclassified to LOWEST-OUTPUT plus one, and so on, until all assignment statements have a reclassified value. Any cell values that fall outside the specified ranges are reclassified to NoData.
The following table summarizes the reclassification:
Input cell value | Output reclassified value |
---|---|
Less than 3 | NoData |
3 to 5 | 2 (lowest-output) |
Greater than 5 to 6 | 3 (lowest-output + 1) |
Greater than 6 to 7 | 4 (lowest-output + 2) |
Greater than 7 to 15 | 5 (lowest-output + 3) |
Greater than 15 | NoData |
If LOWEST-INPUT has not been specified, all cell values less than or equal to 5 would have been reclassified to 2. The reclassified value would have defaulted to 1 if a LOWEST-OUTPUT of 2 was not specified.
Specific output values
You can specify output values for each input value or input range by adding an additional field to the remap table.
The input cell value or value range is followed first by a colon (:), then by the desired output reclassified value. When an explicit output reclassified value is specified, LOWEST-OUTPUT is ignored, for example:
# Example 3 # Remap table for cell value reclassification. LOWEST-INPUT 3 5 : 10 6 : 16 7 : 62 15 : 28
The reclassification is summarized in the following table:
Input cell values | Output reclassified value |
---|---|
Less than 3 | NoData |
3 to 5 | 10 |
Greater than 5 to 6 | 16 |
Greater than 6 to 7 | 62 |
Greater than 7 to 15 | 28 |
Greater than 15 | NoData |
Explicit input ranges
Similarly, an output value can be specified for explicit input ranges:
# Example 4 # Remap table for cell value reclassification. 3 5 : 9 5 9 : 8 13 15 : 59
The reclassification is summarized as shown below:
Input cell value | Output reclassified value |
---|---|
Less than 3 | NoData |
3 to 5 | 9 |
Greater than 5 to 9 | 8 |
Greater than 9 to 13 | NoData |
Greater than 13 to 15 | 59 |
Greater than 15 | NoData |
Invalid example - mixing single input values and ranges
All the examples presented above are valid ASCII remap tables that can be used to reclassify cell values. Each of the four methods shows the acceptable syntax for an ASCII remap table. The syntax cannot be mixed among the four types. For example, it is not valid to specify an assignment statement that contains a single input value followed by another assignment statement that contains an input range.
Below is an invalid remap table. Single input cell values and input ranges cannot be specified in the same remap table.
# Invalid remap table for cell value reclassification LOWEST-INPUT 3 LOWEST-OUTPUT 2 5 6 9 11 15
Invalid example - mixing specified output values
It is also invalid to specify an output reclassified value on only some of the assignment statements in a remap table. If you specify an output value, it must be specified in all assignment statements.
The following is an invalid remap table (all assignment statements must have a specified output value):
# Invalid remap table for cell value reclassification LOWEST-INPUT 3 5 : 10 6 7 : 62 15