other versions
- wheezy 6.4.2-2
- jessie 6.4.4-1
- testing 7.2.0-2
- unstable 7.2.0-2
- experimental 7.2.1-1~exp1
r.recode(1grass) | Grass User's Manual | r.recode(1grass) |
NAME¶
r.recode - Recodes categorical raster maps.KEYWORDS¶
raster, recode categorySYNOPSIS¶
r.recodeFlags:¶
- -a
-
- -d
-
- --overwrite
-
- --verbose
-
- --quiet
-
Parameters:¶
- input=name
-
- output=name
-
- rules=name
-
- title=string
-
DESCRIPTION¶
r.recode creates an output raster map by recoding input raster map based on recode rules. A title for the output raster map may be (optionally) specified by the user. The recode rules can be read from standard input (i.e., from the keyboard, redirected from a file, or piped through another program) by entering rules=-. Rules are defined in one of these formats:old_low:old_high:new_low:new_high
old_low:old_high:new_val (i.e. new_high == new_low)
*:old_val:new_val (interval [inf, old_val])
old_val:*:new_val (interval [old_val, inf])
- 1
- old-low to old-high is reclassed to new-low to new high , where the user provides all four values. The program figures on the fly what type of raster should be created.
- 2
- old-low to old-high is reclassed to a single new value. Anything outside the range is null.
- 3
-
* to old-high will reclass everything less than old-high to a single new value.
- 4
-
old-low to * will reclass everything greater than old-low to a single new value.
EXAMPLES¶
Map type conversion¶
To simply convert a raster between formats (eg. int to float) the user would use the first argument. For example10:1500:0.1:15.0
Value replacement¶
r.recode can be used to replace existing cell values by others. The formatting is as described above. In following example the values 1, 2 and 3 are replaced by 1.1, 7.5 resp. 0.4:1:1:1.1:1.1
2:2:7.5:7.5
3:3:0.4:0.4
AUTHOR¶
CERL Last changed: $Date: 2010-10-31 09:46:46 +0100 (Sun, 31 Oct 2010) $ Full index © 2003-2011 GRASS Development TeamGRASS 6.4.2 |