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. Calculating cell polygons 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
Cell parent Not supported Not Supported Supported
Cell children Not supported Not Supported Supported
Cell rings Not supported Not Supported Supported

Tip

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

Note

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
geo_point_to_geohash()
geo_geohash_to_central_point()
geo_geohash_neighbors()
geo_geohash_to_polygon()

S2 Cell functions

Function Name
geo_point_to_s2cell()
geo_s2cell_to_central_point()
geo_s2cell_neighbors()
geo_s2cell_to_polygon()
geo_polygon_to_s2cells()

H3 Cell functions

Function Name
geo_point_to_h3cell()
geo_h3cell_to_central_point()
geo_h3cell_neighbors()
geo_h3cell_to_polygon()
geo_h3cell_parent()
geo_h3cell_children()
geo_h3cell_rings()