Wherobots now available in Anthropic Connectors Directory Get started here

The Wherobots Notebook Environment – Getting Started With Wherobots Cloud Part 2

Wherobots Initial Notebook

The Wherobots Notebook Environment is the main development interface for developers and data scientists working with WherobotsDB in Wherobots Cloud. In this post we’ll take a look at configuring and starting a notebook environment then see how to work with WherobotsDB via Python and Spatial SQL.

This is the second post in a series that will introduce Wherobots Cloud, covering how to get started with cloud-native geospatial analytics at scale.

Starting The Notebook Environment

After signing in to Wherobots Cloud you’ll be prompted to configure and start a notebook runtime. Anyone can create a Wherobots Cloud account and it’s free to get started.

Configuring the Wherobots Notebook runtime

Free tier users have access to the “Tiny” runtime with a default resource configuration suitable for development and testing. Professional tier users are able to select preconfigured runtimes with more resources or create custom runtimes.

We can also add additional configuration such as AWS S3 bucket credentials or additional Spark configuration before starting the runtime and also select additional Python libraries to be installed into our environment. Many PyData and geospatial Python packages are installed by default so we can typically get started with just the default runtime configuration by clicking the “Start” button.

Starting the runtime creates a Jupyter notebook environment specific to our Wherobots Cloud user. For free tier users this notebook environment will run for 2 hours then shutdown after which we’ll need to restart the runtime, while professional tier users don’t have this restriction.

Example Notebooks

Once our notebook runtime is available we can enter the Jupyter environment by clicking “Open Notebook”. By default we’ll land on a sample notebook which introduces some basic features of SedonaDB. If you’re not familiar with Jupyter it’s an interactive development environment organized around notebooks. Notebooks are made up of cells which can be code or also include text, images, or other interactive widgets. We can run cells individually or from the menu by selecting Run >> Run All Cells to run all cells in the notebook sequentially.

Wherobots Initial Notebook

This initial notebook is a simple example meant to introduce some concepts and familiarize new users with working with SedonaDB. It covers:

  • Configuring the SedonaContext to access the Wherobots Open Data Catalog
  • Exploring the data available in the Wherobots Open Data Catalog
  • Using spatial SQL to query for points of interest by category
  • Visualizing the results using SedonaKepler
Querying the Wherobots Open Data Catalog

This initial notebook is just a starting point and you can also find a number of additional example notebooks in the notebook_example directory in Jupyter. Specifically,

  • The sedona directory includes further examples for working with SedonaDB with Python, Spatial SQL and the Overture Maps dataset
    • sedona-example-python.ipynb – loading data from Shapefiles, performing spatial joins, and writing as GeoParquet
    • sedona-overture-maps.ipynb – explore the Overture Maps dataset including points of interest, administrative boundaries, and road networks
  • The havasu directory contains examples on working with the Havasu spatial table to perform ETL and data analysis using vector and raster data
    • havasu-iceberg-geometry-etl.ipynb– creating Havasu tables, performing spatial operations, working with spatial indexes to optimize performance
    • havasu-iceberg-raster-etl.ipynb – working with the EuroSAT raster dataset as Havasu tables, raster operations, handling CRS transforms, and benchmarking raster geometry operations
    • havasu-iceberg-outdb-raster-etl.ipynb – demonstrates the out-db method of working with large rasters in SedonaDB, loading a large GeoTiff and splitting into tiles, joining vector data with rasters
  • The notebook in the sedonamaps directory shows how to make use of SedonaMaps for map matching and visualizing routes
    • sedonamaps_example.ipynb – matching noisy GPS trajectory data to OpenStreetMap road segments and visualizing the results

Note: Only 1 notebook can be run at a time. If you want to run another notebook, please shut down the kernel of the current notebook first (See instructions here).

Creating Your Own Notebooks & Working With Version Control

Now you can of course create your own notebooks to work with spatial data in Wherobots Cloud. Once you’ve created a notebook there are a few ways to export it, for example you can download the notebook locally but a common workflow is to check notebook changes into version control and then push changes to a system like GitHub or GitLab.

Our Jupyter environment has git installed so we can check our notebooks into version control from the terminal. This is also a good way to import new notebooks. For example, let’s bring in some notebooks from this repository by opening the terminal in Jupyter and running the following command:

git clone https://github.com/johnymontana/30-day-map-challenge
Using version control with the Wherobots Notebook Environment

And now these notebooks are available in our Wherobots notebook environment, so as we make changes to them we can check them in to version control and push those back to our GitHub repository.

Online Resources

As you’re working with Wherobots Cloud be sure to join the Wherobots Community site where you can ask questions if you get stuck and also share your projects with the community.

Here are some other resources you might find useful as you explore SedonaDB and Wherobots Cloud:

  • Wherobots Online Community – Ask questions, share your projects, explore what others are working on in the community, and connect with other members of the community
  • Wherobots YouTube Channel – Find technical tutorials, example videos, and presentations from spatial data experts on the Wherebots YouTube Channel
  • Wherobots Documentation – The documentation includes information about how to manage your Wherobots Cloud account, how to work with data using SedonaDB, as well as reference documentation
  • Wherobots Blog – Keep up to date with the Wherobots and Apache Sedona community including new product announcements, technical tutorials, and highlighting spatial analytics projects

This was a quick introduction to the Wherobots Notebook environment. I hope you’ll enjoy working with Wherobots Cloud and I hope to see you around the Wherobots Community Site!

Try Wherobots Cloud