~ubuntu-branches/ubuntu/vivid/grass/vivid-proposed

« back to all changes in this revision

Viewing changes to raster/r.recode/r.recode.html

  • Committer: Package Import Robot
  • Author(s): Bas Couwenberg
  • Date: 2015-02-20 23:12:08 UTC
  • mfrom: (8.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20150220231208-1u6qvqm84v430b10
Tags: 7.0.0-1~exp1
* New upstream release.
* Update python-ctypes-ternary.patch to use if/else instead of and/or.
* Drop check4dev patch, rely on upstream check.
* Add build dependency on libpq-dev to grass-dev for libpq-fe.h.
* Drop patches applied upstream, refresh remaining patches.
* Update symlinks for images switched from jpg to png.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<h2>DESCRIPTION</h2>
 
2
 
 
3
<em>r.recode</em> creates an output raster map by recoding input
 
4
raster map based on recode <b>rules</b>. A <b>title</b> for the output
 
5
raster map may be (optionally) specified by the user.
 
6
 
 
7
<p>The recode rules can be read from standard input (i.e., from the
 
8
keyboard, redirected from a file, or piped through another program) by
 
9
entering <b>rules=-</b>.
 
10
 
 
11
<p>Rules are defined in one of these formats:
 
12
 
 
13
<div class="code"><pre>
 
14
old_low:old_high:new_low:new_high
 
15
old_low:old_high:new_val  (i.e. new_high == new_low)
 
16
*:old_val:new_val         (interval [inf, old_val])
 
17
old_val:*:new_val         (interval [old_val, inf])
 
18
</pre></div>
 
19
 
 
20
<p><em>r.recode</em> is loosely based
 
21
on <em><a href="r.reclass.html">r.reclass</a></em> and uses the GRASS
 
22
Reclass Library to convert the rasters. It has routines for converting
 
23
to every possible combination of raster (eg. CELL to DCELL, DCELL to
 
24
FCELL, etc). Standard floating point raster precision is float
 
25
(FCELL), with <b>-d</b> double precision (DCELL) will be written.
 
26
 
 
27
<p>There are four basic routines that it accepts:
 
28
 
 
29
<ol>
 
30
  <li>old-low to old-high is reclassed to new-low to new high , where the
 
31
    user provides all four values. The program figures on the fly what type of
 
32
    raster should be created.
 
33
                                                                                
 
34
  <li>old-low to old-high is reclassed to a single new value. Anything outside
 
35
    the range is null.
 
36
 
 
37
  <li> * to old-high will reclass everything less than old-high to a single
 
38
    new value.
 
39
    
 
40
  <li> old-low to * will reclass everything greater than old-low to a single
 
41
    new value.
 
42
</ol>
 
43
 
 
44
These four sets of arguments can be given on the command line, or
 
45
piped via stdin or a file. More than one set of arguments is accepted.
 
46
 
 
47
<h2>EXAMPLES</h2>
 
48
 
 
49
<h3>Map type conversion</h3>
 
50
 
 
51
To simply convert a raster between formats (eg. int to float) the user
 
52
would use the first argument. For example
 
53
 
 
54
<div class="code"><pre>
 
55
10:1500:0.1:15.0
 
56
</pre></div>
 
57
 
 
58
would convert an input raster map with range between 10 and 1500 to a
 
59
float raster raster with range bewteen 0.1 and 15.0.
 
60
 
 
61
<h3>Value replacement</h3>
 
62
 
 
63
<em>r.recode</em> can be used to replace existing cell values by
 
64
others. The formatting is as described above. In following example the
 
65
values 1, 2 and 3 are replaced by 1.1, 7.5 resp. 0.4:
 
66
 
 
67
<div class="code"><pre>
 
68
r.recode input=oldmap output=newmap rules=- &lt;&lt; EOF
 
69
1:1:1.1:1.1
 
70
2:2:7.5:7.5
 
71
3:3:0.4:0.4
 
72
EOF
 
73
</pre></div>
 
74
 
 
75
 
 
76
<h2>AUTHOR</h2>
 
77
 
 
78
CERL
 
79
 
 
80
<p><i>Last changed: $Date: 2014-02-25 20:29:46 +0100 (Tue, 25 Feb 2014) $</i>