Skip to main content
Compacts an array of H3 cell IDs using H3’s compactCells(cells). Complete sets of child cells are replaced by their parents recursively. Cells that cannot be compacted are retained. The result may contain cells at different resolutions and represents the same set of cells when expanded to the original resolution with ST_H3Uncompact. Input cells must be unique, valid H3 cell IDs at the same resolution. H3 errors are propagated. An empty array returns an empty array, and a null array returns null. The order of the returned cells is not guaranteed.

Signature

Return type

Array<Long>

Examples

Compact the 49 resolution 7 descendants of a resolution 5 hexagon back to their ancestor:
Output:
A single cell is retained:
Output: