[GRASS-dev] G7: v.mkhexgrid addon for hexagon creation

Markus Neteler neteler at osgeo.org
Wed Nov 19 15:29:08 PST 2014


I have added v.mkhexgrid as new G7 addon to the Addons repo. The
original author is Trevor Wiens who already implemented it as a Python
script. I made some minor changes to get it running in GRASS GIS 7.

Originally I had hoped that v.voronoi would do the job but it does not
create proper hexagons. I was running:

# desired result:
http://blogs.esri.com/esri/arcgis/files/2013/05/fig3.png (3rd figure
# create first set of points
g.region rast=elevation -p
v.mkgrid -p map=pointpattern1 grid=13,15 position=region breaks=1
# shift grid by half point distance
g.region n=n+500 w=w+500 e=e+500 s=s+500 -p
# create second set of points
v.mkgrid -p map=pointpattern2 grid=13,15 position=region breaks=1
# merge into final point pattern
v.patch input=pointpattern1,pointpattern2 output=pointpattern3
# generate Thiessen, hoping for hexagons
v.voronoi input=pointpattern3 out=hexagon_attempt
# show result
d.mon wx0
sleep 5
d.vect hexagon_attempt type=boundary

(screenshot attached).

In essence, the Addon v.mkhexgrid does the job but it is very CPU/disk
space demanding.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: v_voronoi_no_hexagon1.png
Type: image/png
Size: 103082 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20141120/2b53aff4/attachment-0001.png>

More information about the grass-dev mailing list