finds.dev← search

// the find

c2g-dev/city2graph

★ 1,298 · Python · BSD-3-Clause · updated Jun 2026

Transform geospatial relations into graphs for Graph Neural Networks and network analysis

City2Graph converts urban geospatial datasets — streets, buildings, GTFS transit feeds, OD matrices — into graph representations compatible with PyTorch Geometric and NetworkX. It sits at the intersection of GIS tooling and GNN research, handling the plumbing between GeoPandas DataFrames and tensor-based graph formats. Aimed at urban computing researchers and spatial data scientists who want to train GNNs on city data without writing their own geometry-to-graph converters.

The module breakdown is clean — morphology, transportation, proximity, mobility each get their own file rather than one God-class doing everything. GTFS feed support via DuckDB is a genuine differentiator; most spatial graph tools ignore transit data entirely. The tiered pip install (`city2graph`, `city2graph[cpu]`, `city2graph[cu130]`) is thoughtful — you don't drag in a 2GB PyTorch dependency just to do NetworkX analysis. Code quality infrastructure is solid: Ruff, mypy, numpydoc, pre-commit, codecov — this is not a research prototype that happens to have a README.

The test suite only has two sample GeoJSON files in `tests/data/`, which means coverage is almost certainly shallow on real-world edge cases like malformed geometries, disconnected graphs, or GTFS feeds with missing stop times. The conda install path is already being de-prioritized (README explicitly warns conda isn't officially supported by PyTorch anymore), which will frustrate the academic crowd that still lives in conda environments. Single maintainer as far as the git history suggests — the org account `c2g-dev` exists but commit activity patterns look like one person, so bus factor is a concern for a library people might build research pipelines on. No mention of handling large cities at scale; someone trying to run this on all of OSM for a metro area will hit GeoPandas memory walls fast with no guidance on chunking or streaming.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →