Geospatial clustering

Geospatial data can be analyzed efficiently using grid systems to create geospatial clusters. You can use geospatial tools to aggregate, cluster, partition, reduce, join, and index geospatial data. These tools improve query runtime performance, reduce stored data size, and visualize aggregated geospatial data.

Azure Data Explorer supports the following methods of geospatial clustering:

The core functionalities of these methods are:

  • Calculate hash\index\cell token of geospatial coordinate. Different geospatial coordinates that belong to same cell will have same cell token value.
  • Calculate center point of hash\index\cell token. This point is useful because it may represent all the values in the cell.
  • Calculate cell polygon. This is useful in cell visualization or other calculations, for example, distance, or point in polygon checks.

Compare methods

Criteria Geohash S2 Cell H3 Cell
Levels of hierarchy 18 31 16
Cell shape Rectangle Rectangle Hexagon
Cell edges straight geodesic straight
Projection system None. Encodes latitude and longitude. Cube face centered quadratic transform. Icosahedron face centered gnomonic.
Neighbors count 8 8 6
Noticeable feature Common prefixes indicate points proximity. 31 hierarchy levels. Cell shape is hexagonal.
Performance Superb Superb Fast
Cover polygon with cells Not supported Supported Not supported


If there is no preference for a specific tool, use the S2 Cell.


Although the hashing\indexing of geospatial coordinates is very fast, there are cases where hashing\indexing on ingestion can be applied to improve query runtime. However, this process may increase stored data size.

Geohash functions

Function Name

S2 Cell functions

Function Name

H3 Cell functions

Function Name

Next steps