Explorar o código

r.stats.quantile and r.stats.zonal manuals: examples added

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@71055 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler %!s(int64=8) %!d(string=hai) anos
pai
achega
eccd69ce2d

+ 24 - 0
raster/r.stats.quantile/r.stats.quantile.html

@@ -13,6 +13,30 @@ for floating-point cover maps. It provides quantile calculations,
 which are absent from
 <em><a href="r.stats.zonal.html">r.stats.zonal</a></em>.
 
+<h2>EXAMPLE</h2>
+
+In this example, the raster polygon map <tt>zipcodes</tt> in the North 
+Carolina sample dataset is used to calculate quantile raster statistics using
+the <tt>elevation</tt> raster map: 
+
+<div class="code"><pre>
+g.region raster=zipcodes -p
+
+# print quantiles
+r.stats.quantile base=zipcodes cover=elevation quantiles=3 -p
+27511:0:33.333333:134.717392
+27511:1:66.666667:143.985723
+27513:0:33.333333:140.669993
+27513:1:66.666667:146.279449
+27518:0:33.333333:115.140101
+27518:1:66.666667:129.893723
+[...]
+
+# write out percentile raster maps
+r.stats.quantile base=zipcodes cover=elevation percentiles=25,50,75 \
+  output=zipcodes_elev_q25,zipcodes_elev_q50,zipcodes_elev_q75
+</pre></div>
+
 <h2>SEE ALSO</h2>
 
 <em>

+ 18 - 0
raster/r.stats.zonal/r.stats.zonal.html

@@ -12,6 +12,24 @@ in a "base layer". A variety of standard statistical measures are possible
 for floating-point cover maps at the expense of not supporting
 quantiles. For this, see <em>r.stats.quantile</em>.
 
+<h2>EXAMPLE</h2>
+
+In this example, the raster polygon map <tt>zipcodes</tt> in the North 
+Carolina sample dataset is used to calculate zonal raster statistics using
+the <tt>elevation</tt> raster map: 
+
+<div class="code"><pre>
+g.region raster=zipcodes -p
+
+# pixel count in zipcode areas
+r.stats.zonal base=zipcodes cover=elevation method=count output=zipcodes_elev_count
+r.colors zipcodes_elev_count color=gyr -g
+
+# average elevation in zipcode areas
+r.stats.zonal base=zipcodes cover=elevation method=average output=zipcodes_elev_avg
+r.colors zipcodes_elev_avg color=elevation -g
+</pre></div>
+
 <h2>SEE ALSO</h2>
 <em>
 <a href="r.quantile.html">r.quantile</a>,