This tool can be used to create a hexagonal vector grid. The extent of the hexagonal grid is based
on the extent of a user-specified base file (either vector or raster). The user must also specify the
desired hexagon width (w), which is the distance between opposing sides of each hexagon. The
size (s) each side of the hexagon can then be calculated as,
s = w / [2 x cos(PI / 6)]
. The area of each hexagon (A) is,
A = 3s(w / 2)
. The user must also specify the orientation of the grid with options
of horizontal (pointy side up) and vertical (flat side up).
The following is an example of a Python script using this tool:
wd = pluginHost.getWorkingDirectory()
inputFile = wd + "input.dep"
outputFile = wd + "output.shp"
width = "10.0"
direction = "horizontal"
args = [inputFile, outputFile, width, direction]
pluginHost.runPlugin("CreateHexagonalVectorGrid", args, False)
This is a Groovy script also using this tool:
def wd = pluginHost.getWorkingDirectory()
def inputFile = wd + "input.shp"
def outputFile = wd + "output.shp"
def width = "10.0"
def direction = "vertical"
String[] args = [inputFile, outputFile, width, direction]
pluginHost.runPlugin("CreateHexagonalVectorGrid", args, false)