Install GeoAnalytics Engine on Amazon Web Services Databricks

The Databricks Lakehouse Platform on Amazon Web Services (AWS) provides a unified set of tools for building, deploying, sharing, and maintaining enterprise-grade data solutions at scale. Databricks on AWS integrates with cloud storage and security in your cloud account, and manages and deploys cloud infrastructure on your behalf. Using the steps outlined below, GeoAnalytics Engine can be leveraged within a PySpark notebook hosted in Databricks on AWS.

To complete this install you will need:

  • An active AWS subscription.
  • GeoAnalytics Engine install files. If you have a GeoAnalytics Engine subscription with a username and password, 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.

  • The locator must be locally accessible to all nodes in your Spark cluster.

Prepare the workspace

  1. If you do not have an active Databricks account, create one by starting a Databricks free trial.

  2. Create a Databricks workspace if you don't have one already and open the workspace in a web browser.

  3. Find the jar file downloaded previously and upload it to DBFS. Copy or make note of the jar path. Use the File API Format, for example /dbfs/FileStore/jars/geoanalytics_2_12_x_x_x.jar. Depending on the analysis you will complete, optionally upload the following jars:

    • esri-projection-geographic, if you need to perform a transformation that requires supplementary projection data.

    • geoanalytics-natives to use geocoding or network analysis tools.

  4. 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 JAR_PATH with the File API path noted in step 3.

    Use dark colors for code blocksCopy
    1
    2
    #!/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 PROJECTION_DATA_JAR_PATH with the corresponding File API path noted in step 3. Follow these steps for every esri-projection-geographic jar 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 GEOANALYTICS_NATIVES_JAR_PATH with the corresponding File API path noted in step 3.

    Use dark colors for code blocksCopy
    1
    2
    cp PROJECTION_DATA_JAR_PATH /databricks/jars/
    cp GEOANALYTICS_NATIVES_JAR_PATH /databricks/jars/

Create a cluster

  1. Click the create button to open the Create Cluster page. Choose a name for your cluster.

  2. Choose to deploy either a Multi node or Single node cluster and select a Policy and an Access mode.

  3. Choose a supported Databricks Runtime Version. See Databricks runtime releases for details on runtime components.

  4. Choose your preferred Worker Type and Driver Type options.

  5. Choose an Instance profile and add any Tags if necessary.

  6. Under Advanced Options find Spark Config and paste in the configuration below.

    Use dark colors for code blocksCopy
    1
    2
    3
    spark.plugins com.esri.geoanalytics.Plugin
    spark.serializer org.apache.spark.serializer.KryoSerializer
    spark.kryo.registrator com.esri.geoanalytics.KryoRegistrator
  7. Select Create Cluster.

  8. Install the wheel (.whl) file downloaded previously. 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

  1. 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 Cluster is running.

  2. 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 Reason: Global init script failure in the message, you should check the global init script logs.

  3. 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

  1. Create a new notebook or open an existing one. Choose "Python" as the Default Language and select the cluster created previously for Cluster.
  2. Import the geoanalytics library and authorize it using your username and password or a license file. See Authorization for more information. For example:

    Use dark colors for code blocksCopy
    1
    2
    import geoanalytics
    geoanalytics.auth(username="User1", password="p@ssw0rd")
  3. Try out the API by importing the SQL functions as an easy-to-use alias like ST and listing the first 20 functions in a notebook cell:

    Use dark colors for code blocksCopy
    1
    2
    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, 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.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.