Jelajahi Sumber

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 9 tahun lalu
induk
melakukan
4e492d7810
1 mengubah file dengan 41 tambahan dan 0 penghapusan
  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>
 <h2>EXAMPLES</h2>
 
 
+<h3>Reclass rules examples</h3>
+
 The following examples may help clarify the reclass rules.
 The following examples may help clarify the reclass rules.
 <p><dl>
 <p><dl>
 <dt> 
 <dt> 
@@ -186,6 +188,45 @@ category values 1 and 2),
 the last label which was specified becomes the label for that category.
 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.
 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>
 <h2>SEE ALSO</h2>