Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Lab 10

image image

Overview

This lab introduces you to GeoLibre, a free and open-source cloud-native GIS platform that runs in the browser, on the desktop, and inside Jupyter notebooks. You will use the geolibre Python package, which embeds the complete GeoLibre app in a notebook cell and gives you a leafmap-style Python API for driving it.

What makes GeoLibre different from the mapping libraries you have used so far is that state syncs both ways. Data you add from Python appears in the app UI, and edits you make in the UI — panning, zooming, toggling layers, restyling — are readable back from Python. The whole map is a single .geolibre.json project file that is interchangeable between the notebook, the web app, and the desktop app.


Objectives

By completing this lab, you will be able to:

  1. Create and configure a GeoLibre map in a Jupyter notebook and control its camera from Python.

  2. Add vector data from several sources and formats, including GeoJSON, CSV, and GeoParquet.

  3. Apply data-driven symbology and annotate a map with legends and colorbars.

  4. Add raster layers and compare two of them with a swipe control.

  5. Build a 3D visualization using building-footprint extrusions.

  6. Read live map state back from the UI and save a project for sharing.

# %pip install geolibre

Exercise 1: Creating Your First GeoLibre Map

Exercise 2: Adding Vector Data

Create a new map and add each of the following layers with an appropriate name and style:

Then frame the continental US using set_center() and set_zoom(). (GeoLibre also has zoom_to_layer(), but it asks the live widget for the layer’s extent, so it only works while the map is displayed and connected.)

Exercise 3: Marker Clusters and Heatmaps

Exercise 4: Choropleth Symbology and Legends

Exercise 5: Raster Layers and Swipe Comparison

Exercise 6: 3D Building Extrusions

Exercise 7: Reading State Back from the UI

Exercise 8: Saving and Sharing a Project

Exercise 9: Geoprocessing in the Browser (Bonus, 10 points)

GeoLibre ships more than 1,000 Whitebox geoprocessing tools that run entirely in the browser through WebAssembly. These exercises drive the live widget, so the map must be displayed and finished loading before the tool call runs. Put the Map in one cell, display it, wait for it to render, then run the tool in the next cell.