The practice of binning point data to form a type of 2D histogram, density plot, or what is sometimes called a heatmap, is quite useful as an alternative for the cartographic display of of very dense points sets. This is particularly the case when the points experience significant overlap at the displayed scale. The PointDensity
tool can be used to perform binning based on a regular grid (raster output). This tool, by comparison, bases the binning on a hexagonal grid.
The tool is similar to the CreateHexagonalVectorGrid
tool, however instead will create an output hexagonal grid in which each hexagonal cell possesses a COUNT
attribute which specifies the number of points from an input points file (Shapefile vector) that are contained within the hexagonal cell.
In addition to the names of the input points file and the output Shapefile, 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).
LidarHexBinning
, PointDensity
, CreateHexagonalVectorGrid
def vector_hex_binning(self, vector_points: Vector, width: float, orientation: str = "h") -> Vector: ...