The reclass rules are read from standard input (i.e., from the keyboard, redirected from a file, or piped through another program).
Before using r.reclass the user must know the following:
r.reclass only works on an integer input raster map; if the input map is instead floating point data, you must multiply the input data by some factor to acheive whole number input data, otherwise r.reclass will round the raster values down to the next integer.
Also note that although the user can generate a r.reclass map which is based on another r.reclass map, the new r.reclass map map will be stored in GRASS as a reclass of the original raster map on which the first reclassed map was based. Therefore, while GRASS allows the user to provide r.reclass map layer information which is based on an already reclassified map (for the user's convenience), no r.reclass map layer (i.e., reclass table) will ever be stored as a r.reclass of a r.reclass.
To convert a reclass map to a regular raster map layer, set your geographic region settings to match the settings in the header for the reclass map (with "g.region rast=reclass_map", or viewable by running r.info) and then run r.resample.
r.mapcalc can be used to convert a reclass map to a regular raster map layer as well:
r.mapcalc "raster_map = reclass_map"
where raster_map is the name to be given to the new raster map, and reclass_map is an existing reclass map.
Because r.reclass generates a table referencing some original raster map layer rather than creating a reclassed raster map layer, a r.reclass map layer will no longer be accessible if the original raster map layer upon which it was based is later removed.
A r.reclass map is not a true raster map layer. Rather, it is a table of reclassification values which reference the input raster map layer. Therefore, users who wish to retain reclassified map layers must also save the original input raster map layers from which they were generated. Alternatively r.recode can be used.
Category values which are not explicitly reclassified to a new value by the user will be reclassified to NULL.
where each line of input specifies the category values in the input raster map layer to be reclassified to the new output_category category value. Specification of a label to be associated with the new output map layer category is optional. If specified, it is recorded as the category label for the new category value. The equal sign = is required. The input_category(ies) may consist of single category values or a range of such values in the format "low thru high." The word "thru" must be present.
To include all (remaining) values the asterix "*" can be used. This rule has to be set as last rule. No further rules are accepted after setting this rule. The special rule "* = *" specifies that all categories not expicitly set by one of the above rules should be passed through unaltered instead of being set to NULL.
Categories to become no data are specified by setting the output category value to "NULL".
A line containing only the word end terminates the input.
1 2 3 = 1 good quality 4 5 = 2 poor quality
1 3 5 = 1 poor quality 2 4 6 = 2 good quality * = NULL
1 thru 10 = 1 11 thru 20 = 2 21 thru 30 = 3 30 thru 40 = NULL
1 thru 100 = 1 poor quality 20 thru 50 = 2 medium quality 25 = 3 good quality
1 thru 19 51 thru 100 = 1 poor quality 20 thru 24 26 thru 50 = 2 medium quality 25 = 3 good qualityor as:
1 thru 19 = 1 poor quality 51 thru 100 = 1 20 thru 24 = 2 26 thru 50 = 2 medium quality 25 = 3 good quality
The final example was given to show how the labels are handled. If a new category value appears in more than one rule (as is the case with new category values 1 and 2), the last label which was specified becomes the label for that category. In this case the labels are assigned exactly as in the two previous examples.
Last changed: $Date: 2009-09-19 08:10:59 -0700 (Sat, 19 Sep 2009) $
Main index - raster index - Full index
© 2003-2012 GRASS Development Team