Member-only story
Make joins on geographical data: spatial support in Databricks
Runtime 17.1 introduces geospatial support in Databricks, featuring new Delta datatypes — geography and geometry — and dozens of ST spatial functions.
If you are not yet a member of Medium, you can access the extended version with video on the SunnyData blog for free.
Now it is easy to make joins on geographical data, let’s connect places with delivery orders to our delivery zones/cities.
You will often see two standard codes in data types and error messages: 4326 and CRS84. Both describe the WGS 84 coordinate reference system, which uses latitude and longitude to locate positions on Earth.
EPSG:4326 is the official SRID (Spatial Reference System Identifier), while CRS84 is an equivalent definition used by OGC/WKT, with longitude–latitude axis order. The GEOGRAPHY type in Databricks always uses SRID 4326. The GEOMETRY type can use various SRIDs, or even none, since it can represent abstract x–y coordinate systems not tied to the Earth.
Delivery Zones
So let’s see a map with our cities (delivery zones):
