Skip to content
Geospatial

H3 hexagonal indexing in SQL

Convert coordinates to H3 cells, traverse the hexagonal grid, and run spatial aggregations directly in SQL. H3 min/max statistics let the query planner skip irrelevant Parquet files on large tables.

H3 indexing at 16 resolution levels (continent to sub-meter)
H3-aware file pruning for spatial queries on Delta tables
PostGIS-compatible st_* spatial functions
Resolution Res 0 1,107 km Res 7 1.2 km Res 9 174 m Res 15 0.5 m SELECT h3_latlng_to_cell (lat, lng, 9 ) AS cell, COUNT(*) FROM locations GROUP BY cell ORDER BY 2 DESC

What you can do in SQL

Indexing, traversal, and spatial predicates without leaving the query

Index and aggregate

Convert coordinates into H3 cells, then group, count, and join by cell. Sixteen resolutions span continent-scale buckets down to sub-meter precision.

Traverse the grid

Find neighbors, draw rings and disks, walk paths between cells, and move up or down the resolution hierarchy. Hex topology is built in, not bolted on.

Spatial predicates

PostGIS-style functions for distance, containment, area, centroid, and buffer. Existing spatial SQL ports across with minimal change.

The planner uses H3 to skip files

Spatial queries on large tables only read the files that matter

How pruning works

Each Parquet file records the H3 cell range of its rows. Spatial predicates let the planner drop any file whose range does not intersect the query region.

What it covers

Cell equality, parent and child containment, and distance filters. Composes with Delta partitioning and Z-ordering on the same table.

Run spatial queries where the data lives

H3 indexing and spatial functions built into the SQL engine.