FREC 682 Spatial Analysis

course syllabus


Reclass Maps

r.reclass lets you aggregate raster classes, which is useful for extracting out one or two classes of interest and lumping all other classes into a single "other" category. It does not actually create a new raster map, only a reclass file in the cellhd directory of your mapset referencing an existing map.

You can run r.reclass interactively, entering successive reclass rules at the reclass prompt. The general format of a reclass rule is oldval(s) = newval [label]. Examples:

		2 = 1
		3 4 5 = 2  forest
		5 thru 10 = 3  coniferous forest
		8 thru 12 16 thru 22 = 4  

To resolve inconsistencies (such as the above) succeeding rules overrule prior rules.

When entering reclass rules interactively, terminate rule entry with "end."

It is often easier to re-direct reclass rules from a text file:
r.reclass i=elevation.dem o=elev.reclass < elev.recl.rules

If you g.remove the original map on which a reclass map is based, you will lose the reclass map as well. If you want to create a separate raster file for a reclass map, run r.mapcalc perm.map=reclass.map (see r.mapcalc).



course syllabus