H3 compact
Replaces every complete group of 7 sibling cells with their parent, repeatedly, for the smallest set covering the same area (compactCells).
The set compacts to 1 cell.
| Cell |
|---|
| 892a8471487ffff |
Provenance
- Computed by
- indexing.h3.compact 1.0.0, core 0.1.0
- Model
- H3 v4 compactCells (h3o 0.11)
- Accuracy
- Identical to H3 C
- 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?
How we got thisFormula, worked example, sources, and proof
Model: H3 v4 compactCells (h3o 0.11)
Accuracy: Identical to H3 C
When to use this: Use this to shrink a large set of cells before storing or sending it: wherever seven siblings are all present they are replaced by their parent, repeatedly, giving the smallest mixed-resolution set that covers the same area. It is the usual way to keep an H3 coverage compact. It is what makes large coverages practical to store and ship: a continent-sized area at a fine resolution collapses to a few thousand mixed-resolution cells.
Limitations: The result is mixed resolution, so anything consuming it has to handle cells of different sizes, or expand it again with the uncompact tool. Compaction is exact — the area covered does not change — but it only collapses complete groups, so a set with gaps compacts little. Pentagons, having fewer children, constrain what can collapse. Compaction changes the resolution mix but not the area, so a consumer that assumes one resolution has to uncompact first or it will silently drop the coarse cells.
Worked example: The 7 children of 892a8471487ffff. Source: H3 compactCells: the 7 children compact to their parent, 892a8471487ffff. It is golden test vector v001, and every build checks the tool still gives its answer within its tolerance.
You enter
- Cells
- 8a2a84714847fff 8a2a8471484ffff 8a2a84714857fff 8a2a8471485ffff 8a2a84714867fff 8a2a8471486ffff 8a2a84714877fff
You get
- Cells after
- 1
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
- 2026-09-19, changed: Eight more H3 tools are stable: the cell inspector, grid ring, grid path, parent, children, compact, uncompact, and edges. On 300 cells at every resolution, one in eight a pentagon, they match H3 C exactly, including every path H3 C refuses; cell areas agree to 2e-8 relative even at resolution 15. Results are unchanged. Changelog
Checked against: 20 golden test vectors (download the test vectors, each with its source and tolerance). See how results are checked and every source.
Sources
- H3: A Hexagonal Hierarchical Geospatial Indexing System (API reference v4), Uber Technologies and the H3 contributors, H3 4.x documentation. Indexing, inspection, traversal, hierarchy, directed edges, vertexes, and resolution tables. Read free.
- h3o: a Rust implementation of H3, Hydronium Labs, 0.11.0 (tested against H3 C). CellIndex, LatLng, Resolution. Read free.
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