geoprimsField-grade geospatial math

H3 grid disk (k-ring)

All cells within k steps of a cell (gridDisk); fewer than 3k(k+1)+1 when a pentagon is nearby.

A published result changed on 2026-09-19: The geohash encoder, map tile for a point, tile bounds, H3 grid disk, and haversine distance are now stable, so their results no longer carry the EXPERIMENTAL_TOOL warning; the Web Mercator clamp and pentagon warnings moved to the first position. Each matches published worked examples (Wikipedia, the mercantile README, the Bing Maps Tile System, H3 C, and Rosetta Code) and agrees with a separately written library on 250 to 1,000 cases. No numbers changed. Changelog

6

The disk of radius 1 holds 6 cells. A pentagon is nearby.

  • This disk involves one of the 12 pentagons at this resolution, where cells have five neighbors and distortion is higher.
Cells
Cell
85080003fffffff
8508000bfffffff
8508000ffffffff
85080017fffffff
85080013fffffff
8508001bfffffff
Provenance
Computed by
indexing.h3.grid-disk 1.0.0, core 0.1.0
Model
H3 v4 gridDisk (h3o 0.11), falling back to the safe traversal near pentagons
Accuracy
Identical to H3 C
Notes
1 shown with the answer
Cites
Uber Technologies and the H3 contributors, H3: A Hexagonal Hierarchical Geospatial Indexing System (API reference v4); Hydronium Labs, h3o: a Rust implementation of H3

Something look off?

Your values

Showing an example. Change anything.
Run many at once from a CSV

Loading…

How we got thisFormula, worked example, sources, and proof

Model: H3 v4 gridDisk (h3o 0.11), falling back to the safe traversal near pentagons

Accuracy: Identical to H3 C

When to use this: Use this for neighborhood queries on an H3 grid: every cell within k steps of a center, which is how a local aggregation, a buffer in cell counts, or a spread from a point is expressed. The disk is the usual first step in a spatial join on hexagons. It is also the cheap way to express a buffer: rather than a distance in meters, a disk of k rings at a chosen resolution gives a neighborhood whose size you control by the grid itself.

Limitations: The count is fewer than the hexagonal formula when a pentagon is within reach, and the result says so. Steps are grid distance, not ground distance: the disk is roughly circular but not exactly, and its radius in meters depends on the resolution and, slightly, on where it is. Because the disk is a count of steps, its ground radius changes with resolution and its edge is a ragged hexagon rather than a circle, so a true distance filter still belongs after it.

Worked example: Ring 1 around pentagon 85080003fffffff. Source: add-spatial-indexing-and-raster scenario: 6 cells, not 7. It is golden test vector v023, and every build checks the tool still gives its answer within its tolerance.

You enter

Center cell
85080003fffffff
k (rings)
1

You get

Cells
6

Review: Not yet independently reviewed by a GIS professional.

Last verified: 2026-09-18, 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.

Changes

Checked against: 22 golden test vectors (download the test vectors, each with its source and tolerance). See how results are checked and every source.

Sources

Terms

H3: H3 hexagonal hierarchical index
A global grid of hexagons (and 12 pentagons) at 16 resolutions, each cell about one-seventh the area of its parent, named by a 15-character index. Source: H3 hexagonal index

H3 — H3 hexagonal hierarchical index

A global grid of hexagons (and 12 pentagons) at 16 resolutions, each cell about one-seventh the area of its parent, named by a 15-character index.

Source: H3 hexagonal index