|
@@ -145,6 +145,89 @@ v.vect.stats points=rand5000 area=myzipcodes_wake count_column=num_points \
|
|
v.db.select myzipcodes_wake column=ZIPCODE_,ZIPNAME,avg_elev
|
|
v.db.select myzipcodes_wake column=ZIPCODE_,ZIPNAME,avg_elev
|
|
</pre></div>
|
|
</pre></div>
|
|
|
|
|
|
|
|
+<h3>Point statistics in a hexagonal grid</h3>
|
|
|
|
+
|
|
|
|
+The grid extent and size is influenced by the current computational
|
|
|
|
+region. The extent is based on the vector map
|
|
|
|
+<em>points_of_interest</em> from the basic North Carolina sample dataset.
|
|
|
|
+
|
|
|
|
+<div class="code"><pre>
|
|
|
|
+g.region vector=points_of_interest res=2000 -pa
|
|
|
|
+</pre></div>
|
|
|
|
+
|
|
|
|
+The hexagonal grid is created as a vector map based on the previously
|
|
|
|
+selected extent and size of the grid.
|
|
|
|
+
|
|
|
|
+<div class="code"><pre>
|
|
|
|
+v.mkgrid map=hexagons -h
|
|
|
|
+</pre></div>
|
|
|
|
+
|
|
|
|
+The <em><a href="v.vect.stats.html">v.vect.stats</a></em> module
|
|
|
|
+counts the number of points and does one statistics on a selected
|
|
|
|
+column (here: <em>elev_m</em>).
|
|
|
|
+
|
|
|
|
+<div class="code"><pre>
|
|
|
|
+v.vect.stats points=points_of_interest areas=hexagons method=average \
|
|
|
|
+ points_column=elev_m count_column=count stats_column=average
|
|
|
|
+</pre></div>
|
|
|
|
+
|
|
|
|
+User should note that some of the points may be outside the grid
|
|
|
|
+since the hexagons cannot cover all the area around the edges
|
|
|
|
+(the computational region extent needs to be enlarged if all points
|
|
|
|
+should be considered).
|
|
|
|
+The last command sets the vector map color table to <tt>viridis</tt>
|
|
|
|
+based on the <tt>count</tt> column.
|
|
|
|
+
|
|
|
|
+<div class="code"><pre>
|
|
|
|
+v.colors map=hexagons use=attr column=average color=viridis
|
|
|
|
+</pre></div>
|
|
|
|
+
|
|
|
|
+<!--
|
|
|
|
+v.vect.stats points=points_of_interest areas=hexagons method=average \
|
|
|
|
+ points_column=elev_m count_column=count stats_column=average
|
|
|
|
+v.vect.stats points=points_of_interest areas=hexagons method=range \
|
|
|
|
+ points_column=elev_m count_column=count stats_column=range
|
|
|
|
+v.vect.stats points=points_of_interest areas=hexagons method=stddev \
|
|
|
|
+ points_column=elev_m count_column=count stats_column=stddev
|
|
|
|
+
|
|
|
|
+export GRASS_FONT=LiberationSans-Regular
|
|
|
|
+
|
|
|
|
+FILE=v_vect_stats.png
|
|
|
|
+
|
|
|
|
+rm $FILE
|
|
|
|
+
|
|
|
|
+d.mon cairo out=$FILE
|
|
|
|
+
|
|
|
|
+d.frame frame=f1 at=50,100,0,50 -c
|
|
|
|
+v.colors map=hexagons use=attr column=range color=viridis
|
|
|
|
+d.vect map=points_of_interest color=black fill_color=black width=1 icon=basic/point size=3
|
|
|
|
+d.text text="points" at=60,5 size=10 color=black
|
|
|
|
+
|
|
|
|
+d.frame frame=f2 at=50,100,50,100 -c
|
|
|
|
+v.colors map=hexagons use=attr column=count color=viridis
|
|
|
|
+d.vect map=hexagons where="count > 0"
|
|
|
|
+d.text text="count" at=60,5 size=10 color=black
|
|
|
|
+
|
|
|
|
+d.frame frame=f3 at=0,50,0,50 -c
|
|
|
|
+v.colors map=hexagons use=attr column=average color=viridis
|
|
|
|
+d.vect map=hexagons where="count > 0"
|
|
|
|
+d.text text="average" at=60,5 size=10 color=black
|
|
|
|
+
|
|
|
|
+d.frame frame=f4 at=0,50,50,100 -c
|
|
|
|
+v.colors map=hexagons use=attr column=stddev color=viridis
|
|
|
|
+d.vect map=hexagons where="count > 0"
|
|
|
|
+d.text text="stddev" at=60,5 size=10 color=black
|
|
|
|
+
|
|
|
|
+d.mon stop=cairo
|
|
|
|
+mogrify -trim $FILE
|
|
|
|
+-->
|
|
|
|
+
|
|
|
|
+<center>
|
|
|
|
+<img src="v_vect_stats.png"><br>
|
|
|
|
+Point statistics in a hexagonal grid (count of points, average of values
|
|
|
|
+associated with point, standard deviation)
|
|
|
|
+</center>
|
|
|
|
+
|
|
|
|
|
|
<h2>SEE ALSO</h2>
|
|
<h2>SEE ALSO</h2>
|
|
|
|
|