How Reclass by ASCII File works
An ASCII remap file can be created with any editor that will produce an ASCII text file. Following is some discussion about correctly formulating the ASCII file to use.
For the Reclass by ASCII File tool, the input remap file must be formatted in a specific way. The file can be created in any editor that will produce an ASCII text file.
The following list provides some details on the correct formatting for the ASCII file:
- Comment lines can be entered beginning with the # symbol. There are no limits to the number of comments that can be entered.
- Each assignment line maps a value or range of values from the input raster to an output value. Only numeric values are accepted on an assignment line.
- All assignment lines in an ASCII remap file must be in the same format. Two formats are supported: one for reclassifying individually specified input values, the other for reclassifying ranges of input values.
If a single value is to be reclassified to another value, the value is identified, followed by a space, a colon (:), another space, and the value to assign those cells on the output.
Generically, the assignment line for a single input value appears as:
in_value : out_value
With values, it will appear as:
5 : 20
where the locations that are value 5 on the input raster will be assigned 20 on the output raster. -
For a single input value assignment line, if the input is not directly specified, the output will be either the original input value or NODATA depending on the setting of the missing values check box (Data or NoData).
For example, consider an assignment table that consists of two lines:
5 : 100 7 : 200
If an input value is 2, the output value will either be 2 or NoData depending on the setting of the missing values check box (Data or NoData). If an input value is 5, the output value will be 100. If an input value is 6, the output value will be either 6 or NoData.
-
If a range of values is to be reclassed, the lowest value of the range is specified, followed by a space and the highest value in the range, then followed by a colon (:), another space, and the output value.
Generically, the assignment line for a range of values appears as:
in_min_value in_max_value : out_value
With values, it will appear as:
5 10 : 50
where the values 5, 6, 7, 8, 9, and 10 on the input raster will be assigned 50 on the output raster. The value 3 will be assigned 3 or NoData. The value 12 will be assigned 12 or NoData.
- The values to be mapped (individual or range of values) must be in ascending order, with the lowest value listed first.
- The values in_min_value or in_max_value can be either integer or floating-point numbers. If the output assignment values (out_value) in the remap table are floating-point values, they will be truncated. The output raster for Reclass by ASCII File is always of integer type.
-
The input ranges of values should not overlap except at the boundary of two input ranges. When overlapping occurs, the higher end of the lower input range is inclusive, and the lower end of the higher input range is exclusive; for example:
1 3 : 4 (where 1 <= value <= 3, values remapped to 4) 3 5 : 6 (where 3 < value <= 5, values remapped to 6) 5 7 : 8 (where 5 < value <= 7, values remapped to 8)