Create a simple Geospatial Table with Geography type column
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2024 09:30 AM
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.
- Labels:
-
Spark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2024 10:23 AM
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...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2024 11:04 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2024 12:30 AM
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...

