v.22.4New Feature
Add H3 Distance and Index Functions
Addh3PointDistM,h3PointDistKm,h3PointDistRads,h3GetRes0Indexes,h3GetPentagonIndexesfunctions. #34568 (Bharat Nallan).
Why it matters
These functions provide users with precise distance measurements between geographic points using the H3 hexagonal hierarchical spatial index system in meters, kilometers, and radians. Additionally, they offer capabilities to retrieve base resolution (resolution 0) H3 indexes and identify pentagon cells, improving spatial analysis and indexing operations within ClickHouse.How to use it
Users can invoke these functions in their SQL queries as follows:- Use
h3PointDistM(lat1, lon1, lat2, lon2) to get distance in meters.- Use
h3PointDistKm(lat1, lon1, lat2, lon2) for distance in kilometers.- Use
h3PointDistRads(lat1, lon1, lat2, lon2) for distance in radians.- Use
h3GetRes0Indexes() to obtain all resolution 0 H3 indexes.- Use
h3GetPentagonIndexes() to retrieve indexes of pentagon cells.Simply include these function calls in your SELECT queries to leverage their functionality.