forked from OSGeo/grass
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathr.recode.html
83 lines (60 loc) · 2.52 KB
/
r.recode.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<h2>DESCRIPTION</h2>
<em>r.recode</em> creates an output raster map by recoding input
raster map based on recode <b>rules</b>. A <b>title</b> for the output
raster map may be (optionally) specified by the user.
<p>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 <b>rules=-</b>.
<p>Rules are defined in one of these formats:
<div class="code"><pre>
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])
</pre></div>
<p><em>r.recode</em> is loosely based
on <em><a href="r.reclass.html">r.reclass</a></em> and uses the GRASS
Reclass Library to convert the rasters. It has routines for converting
to every possible combination of raster (eg. CELL to DCELL, DCELL to
FCELL, etc). Standard floating point raster precision is float
(FCELL), with <b>-d</b> double precision (DCELL) will be written.
<p>There are four basic routines that it accepts:
<ol>
<li>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.
<li>old-low to old-high is reclassed to a single new value. Anything outside
the range is null.
<li> * to old-high will reclass everything less than old-high to a single
new value.
<li> old-low to * will reclass everything greater than old-low to a single
new value.
</ol>
These four sets of arguments can be given on the command line, or
piped via stdin or a file. More than one set of arguments is accepted.
<h2>EXAMPLES</h2>
<h3>Map type conversion</h3>
To simply convert a raster between formats (eg. int to float) the user
would use the first argument. For example
<div class="code"><pre>
10:1500:0.1:15.0
</pre></div>
would convert an input raster map with range between 10 and 1500 to a
float raster raster with range between 0.1 and 15.0.
<h3>Value replacement</h3>
<em>r.recode</em> 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:
<div class="code"><pre>
r.recode input=oldmap output=newmap rules=- << EOF
1:1:1.1:1.1
2:2:7.5:7.5
3:3:0.4:0.4
EOF
</pre></div>
<h2>SEE ALSO</h2>
<em>
<a href="r.reclass.html">r.reclass</a>
</em>
<h2>AUTHOR</h2>
CERL