Hexagon grid of cells
A grid of regular hexagons over a polygon in its zone, laid out the way QGIS Create grid does, with each cell's center, its share inside the polygon, and the plane's scale over the area.
Experimental: not yet fully verified. How results are checked
30 hexagons on UTM zone 13N (WGS 84); the plane's scale runs -400 to -400 ppm.
- Origin
- Rotation
- Scale distortion
- Plane
Provenance
- Computed by
- geometry.sampling.hex-grid 1.0.0, core 0.1.0
- Model
- Regular flat-top hexagons of height s (flat to flat, width 1.1547 s) in UTM plane meters from the top-left corner of the polygon's bounding box: columns 0.866 s apart, odd columns shifted down s/2, column by column and top to bottom, as QGIS Create grid lays out a hexagon grid; an optional clockwise rotation; inside fractions from the polygon's triangles clipped to each cell
- Accuracy
- Cell corners are exact on the UTM plane; on the ground a cell's size differs by the plane's scale, reported as a range
- Notes
- 1 shown with the answer
- Cites
- QGIS project (vendor documentation), QGIS Processing algorithm: Create grid
Something look off?
How we got thisFormula, worked example, sources, and proof
Model: Regular flat-top hexagons of height s (flat to flat, width 1.1547 s) in UTM plane meters from the top-left corner of the polygon's bounding box: columns 0.866 s apart, odd columns shifted down s/2, column by column and top to bottom, as QGIS Create grid lays out a hexagon grid; an optional clockwise rotation; inside fractions from the polygon's triangles clipped to each cell
Show your work
Grid
flat-top hexagons of height s, columns 0.866 s apart, odd columns down s/2from the top-left corner, E 500,000 N 4,428,090.197 m= 5 columns × 5 rowsCells
cells with any part inside the polygoncell area 5,542.56 m² on the plane= 30
The same steps an agent gets from the MCP server with explain: true.
Accuracy: Cell corners are exact on the UTM plane; on the ground a cell's size differs by the plane's scale, reported as a range
When to use this: Use this to bin points or plan sampling on hexagons, which have equal neighbors on all six sides and less edge effect than squares. It matches the hexagon grid QGIS would make in the same UTM zone.
Limitations: Sizes are in UTM plane meters, as in QGIS, so a hexagon on the ground differs by the scale shown. Where QGIS would leave the extent's ragged edges bare, edge cells numbered −1 or one past the last are added so the whole polygon is covered. Clipped cells keep their whole outline, with the inside fraction giving how much lies in the polygon. At most 50,000 cells over the extent.
Worked example: 80 m hexagons over a field. Source: A 340 m × 333 m field.
You enter
- Cells
- clip
- Polygon
- 40, -105 40, -104.996 40.003, -104.996 40.003, -105
- Hexagon height
- 80 m
You get
- Cells
- 30
- Origin
- E 500,000 m, N 4,428,090.197 m (40.0030001°, -105°)
- Rotation
- 0°
- Scale distortion
- -400 to -400 ppm
- Plane
- UTM zone 13N (WGS 84)
Review: Not yet independently reviewed by a GIS professional.
Last verified: 2026-10-20, when a maintainer last confirmed this tool's sources at the issuer. See the sources ledger.
Status: version 1.0.0, core 0.1.0. See this tool in the verification report.
Checked against: 21 golden test vectors (download the test vectors, each with its source and tolerance). See how results are checked and every source.
Sources
- QGIS Processing algorithm: Create grid, QGIS project (vendor documentation), QGIS 3.44 user manual. Vector creation: Create grid (rectangle and hexagon types; features from the extent's top-left corner, with row and column indices).
Terms
- UTM: Universal Transverse Mercator
- A grid of 60 zones, each 6° of longitude wide, that turns latitude and longitude into eastings and northings in meters. Source: NGA.SIG.0012 UTM and UPS
Experimental means this tool has not yet met the stable bar: at least 20 golden vectors, differential tests, and an independent worked example.
UTM — Universal Transverse Mercator
A grid of 60 zones, each 6° of longitude wide, that turns latitude and longitude into eastings and northings in meters.
Source: NGA.SIG.0012 UTM and UPS