v.22.1New Feature

Add New Functions for H3 Coordinate System

Add new functions for H3 coordinate system: h3HexAreaKm2, h3CellAreaM2, h3CellAreaRads2. #33479 (Bharat Nallan).
Added new ClickHouse functions for the H3 coordinate system: h3HexAreaKm2, h3CellAreaM2, and h3CellAreaRads2.

Why it matters

These functions provide users with the ability to calculate the area of H3 hexagonal cells in different units (square kilometers, square meters, and square radians), enabling more precise spatial analysis and geospatial computations within ClickHouse.

How to use it

Use the new functions directly in your SQL queries to obtain the area of an H3 cell. For example:

SELECT h3HexAreaKm2(resolution) AS area_km2,
h3CellAreaM2(h3_index) AS area_m2,
h3CellAreaRads2(h3_index) AS area_radians
FROM your_table

Here, replace resolution and h3_index with appropriate values or columns.