Browse Source

r.reclass manual: example added

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@69138 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler 8 years ago
parent
commit
4e492d7810
1 changed files with 41 additions and 0 deletions
  1. 41 0
      raster/r.reclass/r.reclass.html

+ 41 - 0
raster/r.reclass/r.reclass.html

@@ -114,6 +114,8 @@ input.
 
 <h2>EXAMPLES</h2>
 
+<h3>Reclass rules examples</h3>
+
 The following examples may help clarify the reclass rules.
 <p><dl>
 <dt> 
@@ -186,6 +188,45 @@ category values 1 and 2),
 the last label which was specified becomes the label for that category.
 In this case the labels are assigned exactly as in the two previous examples.
 
+<h3>Usage example</h3>
+
+In this example, the 21 classes of the landuse map (North Carolina sample
+dataset) are simplified to 7 classes:
+
+<div class="code"><pre>
+r.category landuse96_28m
+0	not classified
+1	High Intensity Developed
+2	Low Intensity Developed
+3	Cultivated
+[...]
+20	Water Bodies
+21      Unconsolidated Sediment
+
+# use this command or save rules with editor in textfile "landuserecl.txt"
+echo "0 = NULL
+1 2     = 1 developed
+3       = 2 agriculture
+4 6     = 3 herbaceous
+7 8 9   = 4 shrubland
+10 thru 18 = 5 forest
+20      = 6 water
+21      = 7 sediment" &gt; landuserecl.txt
+
+r.reclass input=landuse96_28m output=landclass96_recl \
+  rules=landuserecl.txt \
+  title="Simplified landuse classes 1996"
+
+# verify result
+r.category landuse96_recl
+1	developed
+2	agriculture
+3	herbaceous
+4	shrubland
+5	forest
+6	water
+7	sediment
+</pre></div>
 
 <h2>SEE ALSO</h2>