other versions
- jessie 6.4.4-1
- stretch 7.2.0-2
- testing 7.6.0-1
- unstable 7.6.0-1
- experimental 7.6.1-1~exp1
| r.reclass(1grass) | Grass User's Manual | r.reclass(1grass) |
NAME¶
r.reclass - Reclassify raster map based on category values.KEYWORDS¶
raster, reclassificationSYNOPSIS¶
r.reclassFlags:¶
- --overwrite
-
Allow output files to overwrite existing files
- --verbose
-
Verbose module output
- --quiet
-
Quiet module output
Parameters:¶
- input=name
-
Raster map to be reclassified
- output=name
-
Name for output raster map
- rules=name
-
File containing reclass rules"-" to read from stdin
- title=string
-
Title for the resulting raster map
DESCRIPTION¶
r.reclass creates an output map layer based on an input integer raster map layer. The output map layer will be a reclassification of the input map layer based on reclass rules input to r.reclass, and can be treated in much the same way that raster maps are treated. A TITLE for the output map layer may be (optionally) specified by the user. 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:- 1
- The new categories desired; and, which old categories fit into which new categories.
- 2
- The names of the new categories.
NOTES¶
In fact, the r.reclass program does not generate any new raster map layers (in the interests of disk space conservation). Instead, a reclass table is stored which will be used to reclassify the original raster map layer each time the new (reclassed) map name is requested. As far as the user (and programmer) is concerned, that raster map has been created. 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"
Reclass Rules¶
Each line of input must have the following format:EXAMPLES¶
The following examples may help clarify the reclass rules.-
1. This example reclassifies categories 1, 2 and 3 in the input raster map layer "roads" to category 1 with category label "good quality" in the output map layer, and reclassifies input raster map layer categories 4 and 5 to category 2 with the label "poor quality" in the output map layer.
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 quality
1 thru 19 = 1 poor quality
51 thru 100 = 1
20 thru 24 = 2
26 thru 50 = 2 medium quality
25 = 3 good quality
SEE ALSO¶
r.resample, r.rescale, r.recodeAUTHORS¶
James Westervelt,| GRASS 6.4.4 |