City2Graph tutorials and examples¶
Each tutorial below is a self-contained Jupyter notebook that starts from open data and ends with a graph you can analyse or feed to a graph neural network. The case study and workshop show the library applied end to end.
Choose a tutorial by task¶
| Goal | Data | What you will build | Tutorial |
|---|---|---|---|
| Model urban form | Overture Maps or OpenStreetMap buildings and streets | Heterogeneous building, tessellation, and street graph | Morphological graphs |
| Analyse public transport | London GTFS feed | Stop-to-stop travel-time graph and multimodal isochrones | GTFS transit graphs |
| Model migration or commuting | OD edge list or adjacency matrix | Weighted mobility graph | OD matrices |
| Connect POIs and zones | Points, polygons, and street networks | KNN, Delaunay, Gilbert, Waxman, and contiguity graphs | Spatial proximity graphs |
| Add composite relations | Typed nodes and edges | Metapath-derived edges for heterogeneous GNNs | Metapath construction |
| Build a complete GeoAI pipeline | Multiple open urban datasets | Graph construction, graph autoencoder, and spatial clusters | Liverpool case study |
Tutorials¶
-

Metapath Construction for Heterogeneous GNNs
Build a dual graph of Soho's street network, attach amenities to their nearest segments, and materialise metapath edges between amenities reachable within a few street hops — the composite relations used by heterogeneous GNNs.
-

Morphological Graphs from Overture Maps & OpenStreetMap
Tessellate Liverpool's urban fabric into private and public space, link it to the street network, and export the resulting heterogeneous graph to NetworkX and PyTorch Geometric. Works from both Overture Maps and OSM data.
-

Convert a raw GTFS feed for London into a stop-to-stop travel-time graph, rank stops by betweenness centrality, and draw walk and walk-plus-transit isochrones around chosen origins.
-

OD Matrices to Mobility Graphs
Turn origin–destination data — edge lists or adjacency matrices — into spatial graphs, from a toy grid up to the 2021 census migration flows between all MSOAs of England and Wales.
-

Generate k-nearest-neighbour, Delaunay, Gilbert, and Waxman graphs over Tokyo points of interest, compare Euclidean, Manhattan, and network distances, and apply contiguity graphs to London wards.
-

How to Use Overture Maps Like OSMnx
Bring the OSMnx-like experience to Overture Maps: fetch buildings, streets, and POIs for any place and turn them into analysis-ready graphs — a walkthrough on Medium.
Applied projects¶
-

A reproducible research pipeline for Liverpool: open data are processed into heterogeneous graphs, graph autoencoders are trained on them, and the resulting embeddings are clustered and evaluated to characterise urban structure.
-

Workshop: From Geospatial Data to GNNs
GeoAI in Practice, a hands-on FOSS4G 2026 workshop in two parts: constructing spatial networks from open data, then building a graph autoencoder pipeline for spatial clustering. Runs locally with
uvor on Google Colab.
Community articles¶
| Title | Author | Language | Type | Release |
|---|---|---|---|---|
| City2Graph: Python package for spatial network analysis and GeoAI with GNNs | Yuta Sato | EN | Tutorial | Sep 23, 2025 |
| I created a Python library that converts geospatial data into graph representations for heterogeneous GNNs | Yuta Sato | JA | Tutorial | Oct 14, 2025 |
| Verifying Hiroshima Station Redevelopment with Network Science using city2graph | Koki Eguchi | JA | Blog | Dec 22, 2025 |
| How to Use Overture Maps Like OSMnx — by City2Graph | Yuta Sato | EN | Tutorial | Mar 12, 2026 |
Note: We welcome external examples! Please submit a pull request if you have an example to share.