Ver código fonte

v.to.rast manual: added raster binning example (https://trac.osgeo.org/grass/changeset/65777)

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@65778 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler 9 anos atrás
pai
commit
98788ef1d2

+ 35 - 0
vector/v.to.rast/v.to.rast.html

@@ -88,6 +88,41 @@ v.to.rast input=fields output=myfields use=attr attribute_column=cat label_colum
 r.category myfields
 </pre></div>
 
+
+<h3>Convert vector points to raster with raster cell binning</h3>
+
+In this example, the number of schools per raster cell are counted
+(North Carolina sample dataset):
+
+<div class="code"><pre>
+g.copy vector=schools_wake,myschools_wake
+
+# set computation region for raster binning
+g.region vector=myschools_wake res=5000 -p -a
+
+# add new column for counting
+v.db.addcolumn myschools_wake column="value integer"
+v.db.update myschools_wake column=value value=1
+
+# verify attributes
+v.db.select myschools_wake column=cat,value
+v.out.ascii input=myschools_wake output=- column=value
+
+# export and import on the fly, use 4th column (value) as input
+v.out.ascii input=myschools_wake output=- column=value | r.in.xyz input=- \
+            z=4 output=schools_wake_aggreg method=sum
+
+d.mon wx0
+d.rast schools_wake_aggreg
+d.vect schools_wake 
+d.grid 5000
+</pre></div>
+
+<center>
+<img src="v_to_rast_binning.png" alt="Number of schools per raster cell" border=1><br>
+Number of schools per raster cell
+</center>
+
 <h2>SEE ALSO</h2>
 <em>
 <a href="db.describe.html">db.describe</a>,

BIN
vector/v.to.rast/v_to_rast_binning.png