For existing Apache Sedona users
If you already run Apache Sedona on Databricks, migrating to WherobotsDB takes two required changes, plus one optional improvement.Replace the JAR
Add your Wherobots API key
Optionally switch the Python client
wherobots-sedona provides the fullest Python support for the WherobotsDB JARs, but apache-sedona continues to work. See Install the Python client.Before you start
The following requirements must be met within both your Wherobots Organization and your Databricks workspace:Wherobots Requirements
Wherobots Requirements
- An Admin account within a Professional, Innovation, or Enterprise Edition Organization.
Wherobots Organization members with the User role can use a cluster an Admin has already set up, but cannot create the API key this deployment requires. See Organization Roles.
- Community Edition is not supported. See Organization Editions or Upgrade Organization.
- The BYOS feature enabled on your Organization. Contact Wherobots to enable it. BYOS unlocks both halves of this deployment: read access to the WherobotsDB release artifacts, and the runtime authentication and usage-reporting endpoints the JAR calls. Without it, those endpoints return
403and cluster initialization fails. - A Wherobots API key. See How Wherobots authentication works.
Databricks Requirements
Databricks Requirements
- A Databricks workspace with admin permissions.
- Permission to create clusters, add init scripts, and install cluster libraries.
- A supported Databricks Runtime — see Version compatibility.
- A Unity Catalog volume if you plan to use Shared access mode clusters. Init scripts and JARs for Shared clusters must live in a volume, not in the workspace file system.
- Outbound HTTPS (port 443) from the cluster to Wherobots Cloud, for license metering. A workspace with restricted egress needs Wherobots Cloud allowed; without it,
SedonaContext.createfails to authenticate. - The WherobotsDB release artifacts from Wherobots: the
sedona-dbr-spark-shaded-*JAR, thegeotools-wrapperJAR, and thewherobots_sedonaPython wheel. These are not published to Maven Central or PyPI.
Version compatibility
Choose the JAR and Python wheel that match your Databricks Runtime. Wherobots recommends Long-Term Support (LTS) runtimes for production stability.NoSuchMethodError or ClassNotFoundException.
WherobotsDB is versioned independently of Apache Sedona. Each WherobotsDB release is API-compatible with a specific Apache Sedona version, and the GeoTools wrapper version follows the Sedona version — so VERSION and GEOTOOLS_VERSION are different values. For example:
Install WherobotsDB on a Databricks cluster
Installing WherobotsDB involves staging its artifacts where the cluster can read them, adding an init script that copies the JARs into place at startup, and configuring the cluster to load them. Complete the sections in order.Choose a storage location
Databricks offers two places to keep the JARs and init script. Your cluster’s access mode determines which one you can use./Volumes/YOUR_CATALOG/YOUR_SCHEMA/wherobots as the example volume path. Substitute your own throughout.
Stage the JARs
- Unity Catalog volume
- Workspace files
Create the volume
CREATE VOLUME on the schema. See Create and manage volumes in the Databricks documentation.Create the jars subdirectory
Upload both JARs
Verify
Create the init script
An init script runs on every node of the cluster during startup, before Spark begins accepting work. This one copies the WherobotsDB JARs into/databricks/jars, the directory Databricks adds to the Spark classpath.
Write the script to the same place you staged the JARs in Stage the JARs. Use the tab matching that choice.
- Unity Catalog volume
- Workspace files
Write the script
cat > destination and JARS_SRC.Confirm it was written
<<'EOF' is quoted, so the shell writes the script verbatim — including a literal YOUR_CATALOG if you forget to replace it. Edit the cell before running it.Configure the cluster
Create the cluster
- A Databricks Runtime from Version compatibility.
- An access mode consistent with your storage choice — Shared requires a Unity Catalog volume.
- Either the Standard or Photon runtime engine. Both are supported.
Add the Spark configuration
Set the JDK on DBR 14.3
Attach the init script
Install the Python client
Thewherobots-sedona Python client ships as prebuilt wheels in the WherobotsDB release bundle.
The wheels contain compiled components, so there is no universal py3-none-any build. Each filename encodes a Python version tag and a platform tag, and both must match your cluster:
macosx_* and win_* wheels in the bundle. Those are for local development, not cluster nodes.
Stage the wheel alongside the JARs, using the same storage you chose in Choose a storage location. The examples below are for DBR 17.3 LTS on x86_64 workers — substitute the tags for your cluster.
- Unity Catalog volume
- Workspace files
Upload the wheel
Install it as a cluster library
%pip. Spatial functions that run on executors need the client present on every node.
apache-sedona from PyPI also works and can be installed as an ordinary PyPI library. Use the version matching your JAR’s Apache Sedona compatibility, from the table in Version compatibility. wherobots-sedona is preferred because it tracks the WherobotsDB JARs directly.Validate the installation
Start the cluster, attach a notebook to it, and run the following cells in order.Confirm the JARs were copied
Initialize Sedona
Run the validation query
spark.sql.extensions is set, ST_* functions are also available through plain spark.sql(...) and in SQL cells without calling SedonaContext.create first.Confirm geometries reach Python
Confirm spatial functions run on executors
Scala
WherobotsDB works the same way from Scala:How Wherobots authentication works
WherobotsDB validates your API key at startup and uses it for usage-based billing. Both operations call Wherobots Cloud endpoints that are part of the BYOS feature:- At startup, the JAR authenticates against
POST /apps/authenticate, which returns a workload ID. - While the workload runs, the JAR periodically reports usage heartbeats to
POST /apps/report/{workload_id}.
403 and initialization fails. The same feature grants access to the release artifacts. See Before you start.
Create an API key
Open the API Keys page
Create the key
Copy it immediately
Supply the key to the cluster
Databricks secrets are the recommended method, and the only one that keeps the key out of the cluster configuration.Store the key in a secret scope
Reference it from the Spark config
[REDACTED] in the UI.WHEROBOTS_API_KEY environment variable under Advanced options → Spark → Environment variables, which accepts the same {{secrets/...}} syntax.
If authentication fails, you will see an error when calling SedonaContext.create(spark). Confirm the key is correct and unexpired, that BYOS is enabled for your Organization, and that the cluster has outbound HTTPS to Wherobots Cloud.
Best practices
Runtime selection- Use an LTS runtime — 16.4 LTS or 17.3 LTS — for production.
- Both Standard and Photon engines are supported.
- Match the JAR’s Scala version to the runtime’s Scala version.
- For large datasets, raise
spark.driver.memoryto accommodate global index building. - Raise
spark.driver.maxResultSize— for example to2gor5g— if you hit out-of-memory errors when collecting results.
- Use Unity Catalog volumes for Shared clusters, and for anything you expect to share across clusters.
- Use workspace files only for single-user clusters.
Feature differences from Wherobots Cloud
BYOS provides the WherobotsDB engine on your cluster. Features of the managed Wherobots Cloud platform are not included:- The Wherobots managed catalogs —
wherobots,wherobots_open_data,wherobots_pro_data, and the tutorialexamples_tempcatalog — are not available. Notebooks or jobs that reference them must be pointed at your own catalogs, including Unity Catalog, or read public data directly. - Runtime conveniences that Wherobots Cloud preconfigures — the Spark checkpoint directory, visualization packages such as SedonaKepler, and pre-installed Python dependencies — must be set up on your cluster yourself.
Troubleshooting
ClassNotFoundException, UNRESOLVED_ROUTINE, ST_* functions not recognized, or 'JavaPackage' object is not callable in PySpark
- Confirm the JARs reached the cluster:
ls -la /databricks/jars/sedona-dbr*.jar. If they are absent, the init script did not run or could not read the source path. - Check the init script output. Databricks writes it to the cluster log destination under
init_scripts/, or to Driver logs on the cluster page. - Confirm the init script path and its source type — Volumes or Workspace — match where you actually stored it.
- On Shared access mode clusters, confirm the init script and JARs are in a Unity Catalog volume. Shared clusters cannot read them from the workspace file system.
UnsupportedClassVersionError — the cluster is running JDK 8. On DBR 14.3, set the Spark environment variable JNAME=zulu17-ca-amd64. DBR 15.0 and later use JDK 17 by default. See Version compatibility.
NoSuchMethodError at query time — a Spark or Scala mismatch between the JAR and the runtime. DBR 14.3 and 16.4 LTS use Scala 2.12; DBR 17.3 LTS uses Scala 2.13. See Version compatibility.
ModuleNotFoundError: No module named 'sedona' — the Python client is not installed, or was installed on the notebook rather than the cluster. Install the wheel as a cluster library so it reaches every node. If you are installing by hand, give pip the wheel’s path — wherobots-sedona by name cannot resolve, since the package ships only in the release bundle and not on PyPI.
Spatial functions work on the driver but fail inside rdd.map or a UDF — the Python client is installed on the driver only. Reinstall it as a cluster library and restart the cluster.
Authentication errors from SedonaContext.create — confirm spark.wherobots.api.key resolves. A common cause is a secret scope or key name that does not match the {{secrets/SCOPE/KEY}} reference, which leaves the property set to the literal placeholder text. Also confirm the key has not expired, that BYOS is enabled for your Organization, and that the cluster has outbound HTTPS to Wherobots Cloud.
Appendix: Supported CRS transformations
WherobotsDB performs coordinate reference system transformations throughST_Transform, which accepts three CRS formats for both source and target.
Authority codes
WherobotsDB uses spatialreference.org as its CRS database, which covers several authorities:PROJ strings
Use PROJ.4 format for custom projections.OGC WKT
Use OGC Well-Known Text v1 for a full CRS definition:Behavior worth knowing
-
Coordinate order is lon/lat. If your data is stored lat/lon, apply
ST_FlipCoordinatesfirst. - Transformations run in strict mode. An invalid transformation raises an error rather than returning an approximation.
-
The source CRS can be inferred. If you omit it, WherobotsDB reads the geometry’s SRID, which you can set with
ST_SetSRID:

