We are excited to announce that we just released the first set of geospatial functions in Azure Data Explorer!
Geohashes are a beautiful way to store locations in a single column with a precision based on the length of the hash. This enables the user to summarize data on geographical buckets. We are supporting the transformation from points to geohashes and back.
One of the most exciting new capabilities of KQL is the way to analyze if a given point is contained in a circle or a polygon. The geospatial coordinates are based on the WGS-84 coordinate reference system and the geodetic datum used for measurements on earth is a sphere. Polygon edges are geodesics on the sphere. Over time we are going to extend the functionality even further.
Let's try to get all interesting buildings given on a polygon like this:
The following query leverages the geo-point-in-polygon function and the GeoJSON represenation of Manhattan island without Central Park in order to project all places in the polygon.
datatable(longitude:real, latitude:real, place:string)
real(-73.985654), 40.748487, 'Empire State Building', // In Polygon
real(-73.963249), 40.779525, 'The Metropolitan Museum of Art', // In exterior of polygon
real(-73.874367), 40.777356, 'LaGuardia Airport', // In exterior of polygon
| project place
The result is: "Empire State Building". Besides the polygons it's also possible to define regions based on circles and make use of geo-point-in-circle .
What to do next?
Go out and try it yourself on exciting open datasets like NYC-taxi or NOAA integrated surface data . You could start by exploring the global warming of earth by analyzing the average temperature of November based on geohashes over the course of the last 10 years and create beautiful PowerBI visualizations like this: