Skip to main content
These functions use H3 4.5.0 cells with native XY CRS84 GEOGRAPHY (longitude, latitude in degrees). The public cell index is a positive signed BIGINT, including values above 2^53. Keep it in a lossless 64-bit client type or transmit it as a decimal string; JavaScript Number cannot represent every cell exactly. No GEOMETRY or implicit CRS conversion is supported. Any NULL argument gives NULL. Array elements are unique valid cell indexes, but their order is unspecified; use array_sort for stable display. An invalid cell (including 0, negative values, edge or vertex indexes), resolution, topology, CRS, dimension, or geometry family raises an error. Invalid numeric arguments remain errors even for an EMPTY geography. H3_PolygonToCells selects cells using H3’s standard center-fill (flags = 0), rather than exact spherical ST_Contains/ST_Covers. A nonempty polygon may return []; the result is neither conservative coverage nor a safe replacement for exact spatial predicates. H3’s longitude/latitude fill model has limitations near the antimeridian, poles, and for large polygons. A center on a boundary follows H3 4.5.0 rules. The array can be used as an approximate index, followed by the appropriate exact predicate when correctness needs it. The WITH_H3 BE build option is enabled by default. A BE built with WITH_H3=OFF returns a controlled unsupported error for these functions.

Examples

GEOGRAPHY, BIGINT, INT, ARRAY