Description
This tool will reclassify a raster data source to create a new raster dataset using the 'recode' table you specify. The recode table is a comma delimited text file and determines how values from the input raster are mapped to the output raster values. Two forms of entry are allowed in the recode table (a mixture is allowed within the same table): 1) from-value : to-value, new-value; 2) input-value, output-value. The first type of entry defines a range of values in the input raster that correspond to a single value in the output raster, and is interpreted as from-value <= x < to-value --> new value. Note that the to-value is interpreted as 'just less than the to-value'.
To recode cells that are NoData in the input raster, use either the NODATA or NA keywords in the recode table. For instance, including 'NODATA, 0' as a line in the recode file will recode all NoData cells to 0. To code existing value to NoData, use the NODATA or NA keywords as the target value (e.g. '0, NODATA' or '-100:0,NA' ). These keywords are case sensitive and must be capitalized.
Note that the recode file must be comma delimited, and must include a header line (the first line containing the column headings). When the tool reads the recode file it always ignores the first line, hence the requirement that this header is present. See below for an example of a recode table.
Note that you can specify real numbers as the new values. If the new values in the recode table are all integers, the output raster will be an integer raster. If the new values in the recode table contain real numbers then the output raster will be a double precision rasters if the Imagine Image format is specified (.img) or a floating point raster for all other formats.
Syntax
reclassify(in, file, out);
| in | the input integer raster data source | |
| file | the reclassification table, a delimited text file (with a header row) - see the full help documentation for details. | |
| out | the output integer raster data source |
Example
reclassify(in="C:\data\landcov", file="C:\data\lcrecode1.csv", out="C:\data\newlc");
reclassify(in="C:\data\dem.img", file="C:\data\recodedem.csv", out="C:\data\elev");
IN,OUT
100:300,1
300:301,2
301:302,3
303,4
411:500,5
0, NODATA
INPUT,OUTPUT
100:300,1.1
300:301,2.7
301:302,3.00002
303,4.9999
411:500,5.123456789
NA, 0