v.20.1New Feature

Add Geo Functions from H3 Library to ClickHouse

Add several geo functions from H3 library: h3GetResolution, h3EdgeAngle, h3EdgeLength, h3IsValid and h3kRing. #8034 (Konstantin Malanchev)
Added new geospatial functions from the H3 library to ClickHouse: h3GetResolution, h3EdgeAngle, h3EdgeLength, h3IsValid, and h3kRing.

Why it matters

These functions extend ClickHouse's geospatial capabilities by allowing users to work with H3 hexagonal hierarchical spatial indexing. They enable checking H3 index validity, retrieving resolution, measuring edge lengths and angles, and generating k-rings around H3 cells. This solves the problem of limited native support for H3 operations and provides users with more precise and flexible spatial data analysis.

How to use it

Users can call the new H3 functions directly in their SQL queries. For example, use h3IsValid(h3_index) to check if an H3 index is valid, or h3kRing(h3_index, k) to get the hexagons within k rings of a given cell. No special configuration is required; the functions are available after updating to the version containing this feature.