Liverpool case study for City2Graph.
city2graph-case-study
βββ configs
β βββ experiment_config.yaml
βββ data
β βββ outputs
β β βββ checkpoints
β β βββ clusters
β β βββ embeddings
β β βββ figures
β β βββ tables
β βββ processed
β β βββ features
β β βββ graphs
β β βββ isochrones
β βββ raw
β βββ gtfs
β βββ output_area
β βββ overture
βββ notebooks
β βββ 01_data_processing.ipynb
β βββ 02_graph_construction.ipynb
β βββ 03_model_training.ipynb
β βββ 04_evaluation.ipynb
β βββ 05_visualization.ipynb
β βββ appendix_evaluation_hdbscan.ipynb
βββ notebooks_samples
β βββ data
β βββ morphology.ipynb
β βββ morphology_combined.jpg
β βββ morphology_graph.jpg
β βββ morphology_steps.jpg
β βββ transportation_mobility.ipynb
βββ src
β βββ baselines
β β βββ __init__.py
β β βββ kmeans.py
β βββ models
β βββ __init__.py
β βββ gat_gae.py
β βββ han_gae.py
β βββ utils.py
βββ pyproject.toml
βββ uv.lock
βββ .gitignore
βββ .python-version
βββ README.md
The full data directory is hosted on Zenodo:
Sato, Y. (2026). Case Study Data for City2Graph: Clustering Urban Functions in Liverpool [Data set]. Zenodo. https://doi.org/10.5281/zenodo.18396286
Download the Zenodo archive and unzip it to the repository root so the data/ directory matches the expected structure.
GATGAE: 2-layer GAT encoder with DistMult structure decoder for the homogeneous contiguity graph.HANGAE: 2-layer HAN encoder with semantic attention across metapaths, DistMult per relation.run_kmeans: K-Means clustering for embeddings and baseline feature clustering.
- Prepare for the data in data/
- Run notebooks/01_data_processing.ipynb
|
|
|
|
|
|
|
|


Results (embeddings, clusters, tables, and figures) are written under data/outputs/.
This case study uses uv for dependency management and environment reproducibility.
- Dependency specification:
pyproject.toml - Resolved, reproducible lockfile:
uv.lock - Python version pin:
.python-version(3.12.8)
To reproduce the exact environment from this repository:
uv syncTo verify installed package versions in the uv environment:
uv run python - <<'PY'
from importlib.metadata import version
packages = [
"city2graph",
"contextily",
"geopandas",
"hdbscan",
"ipykernel",
"jupyter",
"mapclassify",
"matplotlib",
"matplotlib-scalebar",
"networkx",
"numpy",
"pandas",
"PyYAML",
"scikit-learn",
"seaborn",
"splot",
"torch",
"torch-geometric",
"torchaudio",
"torchvision",
]
for pkg in packages:
print(f"{pkg}=={version(pkg)}")
PYThis case study was run on a CPU of Apple M2 (ARM) with 16 GB RAM, and CUDA was not used.
| Source | Data used | License / attribution | Source URL(s) |
|---|---|---|---|
| Office for National Statistics (ONS) | Output Areas (Dec 2021) EW BGC V2 boundaries; Output Areas (Dec 2021) population-weighted centroids V3 | Open Government Licence v3.0; Contains OS data Β© Crown copyright and database right 2023 (boundaries). Β© Crown copyright and database right 2024 (centroids). See https://www.ons.gov.uk/methodology/geography/licences. | https://geoportal.statistics.gov.uk/datasets/6beafcfd9b9c4c9993a06b6b199d7e6d_0; https://geoportal.statistics.gov.uk/datasets/ons::output-areas-december-2021-ew-population-weighted-centroids-v3 |
| Overture Maps Foundation | Places (POIs), Base (land_use), Transportation (segment + connector), release 2025-12-17.0 | Β© OpenStreetMap contributors, Overture Maps Foundation. Accessed on Janurary 28th, 2026. See https://docs.overturemaps.org/attribution/. | https://overturemaps.org |
| UK Department for Transport (DfT) | Bus Open Data (GTFS timetables), North West feed (accessed Dec 10, 2025) | Open Government Licence v3.0; Β© Crown copyright. See https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/. | https://findtransportdata.dft.gov.uk/dataset/bus-open-data---download-all-timetable-data--18335fb19c4 |
| Metropolitan Transportation Authority (MTA) | GTFS schedules for NYC Subway (used in notebook samples) | Use is subject to MTA data feed terms and conditions. See https://www.mta.info/developers/terms-and-conditions | https://www.mta.info/developers |
| NY Open Data | MTA Subway OriginβDestination Ridership Estimate: Beginning 2025 (used in notebook samples) | Attribution in dataset metadata: βMetropolitan Transportation Authorityβ, with attribution link https://www.mta.info/open-data. | https://data.ny.gov/Transportation/MTA-Subway-Origin-Destination-Ridership-Estimate-B/y2qv-fytt |













