cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Create a simple Geospatial Table with Geography type column

lakshgisprog
New Contributor II

Hello All

I am looking for guidance on creating an simple US states table with shape as Geography column type. I do not want to use Apache Sedona (due to cluster limitations). I am going to create an Node JS application which is going to query this geospatial data.  

3 REPLIES 3

filipniziol
Contributor III

Hi @lakshgisprog ,

Recently there was a technical article on geospatial data processing. You may start with that one:
https://community.databricks.com/t5/technical-blog/from-raw-to-refined-processing-overture-maps-geos...

lakshgisprog
New Contributor II

Thank you for prompt response. Yes, I have gone through the blog. I followed the same process ; for examples, buildings table have geometry which stores as binary type. My question, how to store geometry in 'Geography' type.  The GEOGRAPHY data type follows the WGS 84 standard (spatial reference ID 4326; for details, see https://epsg.io/4326).

My use case is creating an Node JS application to query the geospatial data and perform spatial operations.

Second part of Danny Blog is using Sedona for dynamic segmentation. Since my compute is shared, I cannot use external library rather want to explore native spatial types and operation.

Let me know if you have some pointers.

Hi @lakshgisprog ,

In databricks there is no GEOGRAPHY data type. 
Please check the documentation for the available data types:
https://docs.databricks.com/en/sql/language-manual/sql-ref-datatypes.html

What you can do is:
1. You can store GEOGRAPHY as BINARY or STRING in delta table

2. After reading the data from the table you will convert it in your Node JS application into GEOGRAPHY data type

Also, for transformations on Databricks side you should be able to use ST expressions and H3 library on the shared cluster with photon-enabled clusters, as H3 library is installed by default:
https://learn.microsoft.com/en-us/azure/databricks/sql/language-manual/sql-ref-h3-geospatial-functio...

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group