Grid Generator

Click two points to define a bounding box, then set the cell size and generate a coordinate grid.

Cell Size:
🔲Click on the map to set the first corner of the grid area.

About This Tool

The Grid Generator creates a regular spatial grid of square or hexagonal cells over a user-defined bounding box. Spatial grids are used in environmental monitoring (dividing a study area into sampling units), urban planning (zoning analysis), epidemiology (aggregating case data into uniform cells), and any spatial analysis that requires a tessellated reference framework.

Input

A bounding box defined by two diagonal corner clicks on the map, a grid type (square or hexagonal), a cell size, and a unit (metres, kilometres, or miles). The grid regenerates automatically when parameters change.

Output

The grid rendered on the map and available as GeoJSON (FeatureCollection of Polygon features, one per cell) or KML (one <Placemark> per cell, outline only, no fill). The summary bar shows cell count, individual cell size, and bounding box corners.

Key Concepts

Square grid
Axis-aligned rectangular cells of equal width and height in the chosen unit, computed geodesically on the WGS84 sphere using Turf.js squareGrid. On a Mercator map, cells appear to narrow at higher latitudes because the projection stretches longitude — but their real-world ground dimensions remain equal across the grid.
Hexagonal grid (flat-top)
Tessellating regular hexagons with the specified circumradius (centre-to-vertex distance). Each cell has exactly six equidistant neighbours, which reduces the directional bias inherent in square grids — a key advantage for network analysis, disease spread modelling, and any application where isotropy matters. Generated using Turf.js hexGrid.
Bounding box
The minimum axis-aligned rectangle enclosing the two corner clicks, expressed internally as [min_lng, min_lat, max_lng, max_lat]. Cells that intersect the bounding box boundary are included in full — the grid is not clipped to the box, so edge cells may extend slightly beyond it.