geoprimsField-grade geospatial math

H3 polygon fill (polygonToCells)

The cells that fill a polygon (with holes, across the antimeridian) at a resolution, by an explicit containment mode: cell centers inside, whole cells inside, or any overlap.

Go the other way: H3 cell set outline (cellsToMultiPolygon) →

9

The polygon fills with 9 cells by center containment.

Cells
Cell
892a8471403ffff
892a847140bffff
892a8471413ffff
892a847141bffff
892a8471447ffff
892a8471453ffff
892a8471457ffff
892a84714c7ffff
892a84714cfffff
Containment used
Estimate
Covered area
South
West
North
Provenance
Computed by
indexing.h3.polygon-to-cells 1.0.0, core 0.1.0
Model
H3 C polygonToCells containment tests (point in polygon on latitude and longitude, boundary crossings), breadth-first fill from cells along every edge
Accuracy
Identical cell sets to H3 C 4.4.1 in center, full, and overlapping modes on 1,000 random polygons with holes and antimeridian crossings
Notes
None
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.
KML, KMZ, GPX, GeoJSON, CSV, WKT, or WKB — or drop it on the box. Read on this device.
More options 3
Run many at once from a CSV

Loading…

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

Model: H3 C polygonToCells containment tests (point in polygon on latitude and longitude, boundary crossings), breadth-first fill from cells along every edge

Accuracy: Identical cell sets to H3 C 4.4.1 in center, full, and overlapping modes on 1,000 random polygons with holes and antimeridian crossings

When to use this: Use this to turn an area into cells: the H3 cells that fill a polygon, with holes and across the antimeridian, at a resolution you choose. It is how a region, a service area, or an administrative boundary becomes a set of keys that rows can be joined on.

Limitations: Which cells count as inside is a choice, not a fact, so the containment mode has to be stated: centers inside, whole cells inside, or any overlap all give different sets, and the difference is largest at coarse resolutions relative to the polygon. A fine resolution over a large area produces very many cells. A polygon cannot take in a pole: H3 reads a ring in latitude and longitude with straight edges, so a ring at one latitude encloses no area and comes back with nothing rather than with the cap it looks like.

Worked example: A block in downtown Pittsburgh at resolution 9. Source: H3 polygonToCells. It is golden test vector v001, and every build checks the tool still gives its answer within its tolerance.

You enter

Containment
center
Polygon
40.4406, -80.002 40.4406, -79.99 40.448, -79.99 40.448, -80.002
Resolution
9

You get

Cells
9
Containment used
center
Estimate
28
Covered area
0.947955 km²
South
40.438996519°
West
-80.003535216°
North
40.448391063°
East
-79.988032515°

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: 23 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