This workshop introduces Graph Neural Networks (GNNs) for geospatial practitioners. Using open-source Python tools including PyTorch Geometric and City2Graph, participants will learn how to transform urban geospatial data into network structures and apply GNNs to model complex spatial relations.
Part 1: Graph Data Engineering, Spatial Network Analysis, and GNNs (Notebook WIP)
Learn to construct and analyse spatial networks using GeoPandas and NetworkX. We will demonstrate how to convert standard geospatial data (e.g., OpenStreetMap, GTFS, etc.) into unified graph structures with OSMnx and City2Graph. We will then explore key GNN architectures and transition from spatial graphs into tensor formats using PyTorch Geometric and City2Graph.
Part 2: Build Your Own GeoAI Pipeline Jupyter Notebook
Put your skills into practice. Choose a city, extract its street network from OpenStreetMap or Overture Maps (optional), and train a Graph Autoencoder (GAE) for an unsupervised spatial clustering task. We will conclude by discussing how the GNN pipeline could be adopted for your business / research workflows.
Google Colab is also available:
This repository uses uv for environment and dependency management.
I. Install dependencies and create the local virtual environment:
uv syncII. Start Jupyter Notebook using either of these options:
Option A: run Jupyter directly with uv:
uv run jupyter notebookOption B: activate the virtual environment in your editor terminal, then launch Jupyter:
source .venv/bin/activate
jupyter notebookIII. Open notebooks/part2_geoai.ipynb in Jupyter Notebook.
Python >=3.11,<3.14 is required. If uv is not installed yet, see the uv installation guide.
If you are using Google Colab, you need to have a Google account. The Colab link provided above is in viewer mode, so please save a copy to your own Google Drive (File > Save a copy in Drive) before running the notebook.
-
Target Audience: GIS analysts, spatial data scientists, and Python developers expanding their GeoAI and network modelling skills.
-
Prerequisites: Basic proficiency in Python (especially GeoPandas) and GIS concepts. Basic knowledge of machine learning and neural networks (e.g., supervised vs. unsupervised learning, loss functions, activation functions, backpropagation). If you are not familiar with those topics of neural networks, I recommend watching 3Blue1Brown’s tutorial videos (Chapter 1-4) in advance (English Español 한국어 हिंदी 日本語 русский 中文). No prior network science (NetworkX) or GNN (PyTorch Geometric) skills required.
- 2026-03-08: Repository updated for the upcoming workshop in FOSS4G 2026 Hiroshima.