The Databricks Data Intelligence Platform provides a unified set of tools for building, deploying, sharing, and maintaining enterprise-grade data solutions at scale. Databricks integrates with cloud storage and security in your cloud account, and manages and deploys cloud infrastructure on your behalf. The Databricks Runtime releases include both open source technologies like Apache Spark, as well as a number of proprietary tools that integrate and expand these technologies to add optimized performance and ease of use.
GeoAnalytics Engine can be installed on Databricks in Azure, AWS, or Google Cloud Platform to add spatial data science and analysis capabilities to your Databricks workspace. After installing GeoAnalytics Engine, you will be able to run spatial SQL functions and analysis tools using a Spark cluster managed by Databricks. Because GeoAnalytics Engine extends PySpark, you can spatially-enable your data wherever it lives and seamlessly execute spatial analysis workflows alongside other data science and machine learning technologies in a Databricks notebook.
Databricks runtime support
The table below summarizes the Databricks Runtime releases supported by each version of GeoAnalytics Engine. Both the Databricks Runtime and Databricks Runtime for Machine Learning are supported. See Databricks runtime releases for details on runtime components.
| GeoAnalytics Engine | Databricks Runtimes |
|---|---|
| 1.7.x | 12.2-17.3 |
| 2.0.x | 13.3-18.1 |
| 2.1.x | 13.3-18.2 |
| 2.2.x | 14.3-19 |
Databricks compute policy and access mode support
GeoAnalytics Engine support depends on the compute policy, access mode, and whether your workspace is enabled for Unity Catalog. See Databricks' compute selection recommendations to choose a configuration for your workload. To confirm that Unity Catalog is enabled, follow Databricks' instructions.
The diagram below shows how compute policy and access mode determine GeoAnalytics Engine support in a Unity Catalog-enabled workspace. The partial support table summarizes supported features when full support is not available.
Partial Support table
| SQL Functions | Track Functions | Raster Functions | Tools | Spatial Data Sources | Utilities | DataFrame extensions | |
|---|---|---|---|---|---|---|---|
| 1 | 1 | 1 | 1 | 2 |
- 1. Scala not supported.
- 2. File geodatabase, GeoJSON, Raster, and Shapefile are not supported
Databricks recommends migrating existing workspaces to Unity Catalog. Full compatibility with Databricks workspaces that are not enabled for Unity Catalog is not guaranteed. For the best user experience, we strongly recommend migrating to a Unity Catalog-enabled Databricks workspace when using GeoAnalytics Engine 2.2 or later.
GeoAnalytics Engine does not fully support the Photon query engine and you may experience degraded performance of GeoAnalytics Engine tools, functions, and spatial data sources when Photon is enabled. It is recommended to disable Photon if the majority of your workflows will utilize GeoAnalytics Engine functionality.
Install
By following the steps below, you can leverage GeoAnalytics Engine within a Databricks notebook. To complete the installation, you will need:
- An active subscription to AWS, Azure, or Google Cloud Platform.
-
GeoAnalytics Engine install files. If you have a connected GeoAnalytics Engine subscription, you can download the ArcGIS GeoAnalytics Engine distribution here after signing in. If you have a license file, follow the instructions provided with your license file to download the GeoAnalytics Engine distribution.
-
A GeoAnalytics Engine subscription, or a license file.
Prepare the workspace
-
If you do not have an active Databricks account, create one by starting a Databricks free trial.
-
Create a Databricks workspace if you don't have one already and open the workspace in a web browser.
-
Find the jar file downloaded previously and import it as a Databricks workspace file or upload it to Databricks' Unity Catalog volumes. Copy or make note of the jar path. Use the File API Format, for example
/. Depending on the analysis you will complete, optionally upload the following jars:Workspace/ Shared/engine/jars/geoanalytics _2 _13 _x _x _x.jar esri-projection-geographic, if you need to perform a transformation that requires supplementary projection data.geoanalytics-nativesto use geocoding or network analysis tools.geoanalytics-rasterto use raster functions, tools, and data sources.geoanalytics-geoenrichmentto use GeoEnrichment tools.
-
Use the script below as a Cluster-scoped init script to install GeoAnalytics Engine on only this cluster. You can alternatively use it as a Global init script to install GeoAnalytics Engine on all clusters in your Databricks workspace. Replace
JARwith the File API path noted in step 3._PATH Use dark colors for code blocks Copy #!/bin/bash cp JAR_PATH /databricks/jars/If you need to perform a transformation that requires supplementary projection data, add the first line in the example below to the script and replace
PROJECTIONwith the corresponding File API path noted in step 3. Follow these steps for every_DATA _JAR _PATH esri-projection-geographicjar that you previously uploaded.If you are planning to use geocoding or network analysis tools, add the second line in the example below to the script and replace
GEOANALYTICSwith the corresponding File API path noted in step 3._NATIVES _JAR _PATH If you are planning to use raster functions, tools, or data sources, add the third line in the example below to the script and replace
GEOANALYTICSwith the corresponding File API path noted in step 3._RASTER _JAR _PATH If you are planning to use GeoEnrichment tools, add the fourth line in the example below to the script and replace
GEOANALYTICSwith the corresponding File API path noted in step 3._GEOENRICHMENT _JAR _PATH Use dark colors for code blocks Copy cp PROJECTION_DATA_JAR_PATH /databricks/jars/ cp GEOANALYTICS_NATIVES_JAR_PATH /databricks/jars/ cp GEOANALYTICS_RASTER_JAR_PATH /databricks/jars/ cp GEOANALYTICS_GEOENRICHMENT_JAR_PATH /databricks/jars/ -
If your workspace is enabled for Unity Catalog and you intend to use Standard Access Mode or Shared Compute, you must add the init script from step 4 and any jar files from step 3 to the Unity Catalog allowlist before continuing.
Create a cluster
- In the workspace sidebar, go to Compute, and click the Create compute button to open the New compute page.
- In the General section, choose a name for your cluster and select an appropriate Policy for your workflow.
- In the Performance section, choose a supported Databricks Runtime Version and choose whether or not to enable Photon acceleration and Machine learning. See Databricks runtime support for more details.
- Choose your preferred Worker Type and Driver Type options.
- For the other parameters in the Performance section, use the default or change them to your preference.
- Under Advanced section click on Access mode and select an appropriate Access mode for your workflow.
- Under Advanced section click on Spark and, at a minimum, paste in the configuration below.
You may also need to set the following optional configuration properties depending on your workflows:
Use dark colors for code blocks Copy spark.plugins com.esri.geoanalytics.Plugin spark.serializer org.apache.spark.serializer.KryoSerializer spark.kryo.registrator com.esri.geoanalytics.KryoRegistratorspark.geoanalytics.sql.functions.prefix—It is recommended to set a prefix for GeoAnalytics Engine SQL functions using this property when using Databricks 17.1 and above. Setting a prefix avoids conflation with built-in Databricks spatial functions that may have the same name. For example, ifESRIis set as the SQL function prefix,_ ESRIis prepended to each GeoAnalytics SQL function name. That is,_ STbecomes_Point ESRI._ST _Point geoanalytics.sql.tools.sql—Set toPlanning falseto use analysis tools when installing GeoAnalytics Engine in a Unity Catalog-enabled workspace and when you are using Shared Compute or Standard Access Mode (formerly known as Shared Access Mode). The default istrue.spark.databricks.delta.format—Set toCheck.enabled falseto read from feature services in Databricks.spark.sql.sources.use—If your workspace is enabled for Unity Catalog and you are using Shared Compute or Standard Access Mode (formerly known as Shared Access Mode), V2 data source implementations are not supported. To use the V1 implementations of these data sources you must list them with this configuration property. For exampleV1 Source List feature-service,image-service,. For more information see Data sources.CRF spark.sql.sources.commit—Set toProtocol Class org.apache.spark.sql.execution.datasources.or another supported commit protocol class to write to shapefiles in Databricks.SQL Hadoop Map Reduce Commit Protocol
- Under Advanced section click on Init Scripts and specify the path to the init script created previously.
- Select Create compute.
- Install
the wheel (
.whl) file downloaded previously by clicking on the Libraries tab of the cluster. Installing the file will make it available to import as a python library in a notebook. You can choose to either install the library for every cluster in your workspace or only on the cluster you are creating now. Install any other Python libraries you will need at this time.
(Optional) Check cluster status and view logs
-
To make sure your cluster has been successfully created, look in the Event Log of the created cluster and check for Event Type of RUNNING, usually you will see under message it indicates Compute is running.
-
If cluster creation failed, you will find Event Type of TERMINATING under Event Log. The message of TERMINATING event should give you more context of failure. For example, if you see
Reasonin the message, you should check the init script logs.: Init script failure -
If the failure reason isn't clear from Event Log, check the Driver Logs which will provide more information in standard output, standard error, and Log4j logs to help with debugging.
Authorize GeoAnalytics Engine
-
Create a new notebook or open an existing one. Choose "Python" as the default language and attach the notebook to the cluster created previously.
-
Import the geoanalytics library and authorize it using a username and password, an API key, or a license file. See Authorization for more information. For example:
Python Python Scala Use dark colors for code blocks Copy import geoanalytics geoanalytics.auth(username="User1", password="p@ssw0rd") -
Try out the API by importing the SQL functions as an easy-to-use alias like
STand listing the first 20 functions in a notebook cell:Python Python Scala Use dark colors for code blocks Copy from geoanalytics.sql import functions as ST spark.sql("show user functions like 'ST_*'").show()
What's next?
You can now use any SQL function, track function, raster function, or analysis tool in the geoanalytics module.
See Data sources and Using DataFrames to learn more about how to access your data from your notebook. Also see Visualize results to get started with viewing your data on a map. For examples of what else is possible with GeoAnalytics Engine, check out the sample notebooks, tutorials, and blog posts.