# c2g-dev/city2graph

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

Repository: https://github.com/c2g-dev/city2graph
Canonical: https://ross.abutalabs.com/products/city2graph
Homepage: https://city2graph.net
Language: Python
License: BSD-3-Clause
License Family: permissive
Topics: network-analysis, spatial-analysis, geographical-information-system, graph-neural-networks, pytorch-geometric, geographic-data-science, graph-representation-learning, mobility, transportation, gis, urban-morphometrics, gnn, overturemaps, geospatial-analysis, geoai, geospatial, python, good-first-issue, city2graph, urban
Last push: 2026-08-18T10:22:38+00:00

## Health v2 (maintenance only)
Score: 86/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 98, release rhythm 95, longevity 42
- inputs: {"age_days": 593, "days_push": 15, "days_rel": 32, "gap_med": 11.5, "n_releases_24m": 17}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1872, forks 197 (observed 2026-08-28T04:05:46.917087+00:00)

## What it is
City2Graph is a Python library that converts geospatial data such as buildings, streets, GTFS transit feeds, and origin-destination matrices into spatial and heterogeneous graphs. It bridges GeoPandas, NetworkX, and PyTorch Geometric so the same data supports both network analysis and Graph Neural Network workflows.

## Use cases
- convert openstreetmap buildings and streets into graphs for gnn training
- build stop-to-stop transit graphs from gtfs feeds
- turn origin-destination mobility matrices into weighted spatial graphs
- compute knn delaunay or queen contiguity spatial weights
- convert geodataframes to pytorch geometric heterodata tensors
- urban morphology and street network analysis
- spatial knowledge graphs for geoai applications

## When to choose
- you need to bridge geospatial vector data with graph neural networks
- you work with gtfs, gbfs, or od flow data and want graph representations
- you want one library spanning geopandas, networkx, and pytorch geometric
- you do urban analytics, transportation, or geoai research in python

## When to avoid
- you need raster or satellite imagery processing rather than vector graphs
- you need production gnn training infrastructure rather than graph construction
- you work outside python or need non-geospatial graph databases

## Facets
- artifact type: library
- maturity: active
- function: geospatial, machine-learning, data-science, parser
- domain: machine-learning, data-science
- platform: python, cross-platform
- tags: graph-neural-networks, pytorch-geometric, urban-analytics, gis, network-analysis, gtfs, mobility, spatial-graphs, geopandas, networkx, geoai, urban-morphology, geospatial, maps, transportation

## Member repositories
- c2g-dev/city2graph (main) score 86

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:46.917087+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:14:57.143338+00:00, confidence not recorded.
  - readme: https://github.com/c2g-dev/city2graph (fetched 2026-08-28T04:05:46.917087+00:00, sha 517aa60ab098)
  - registry_pypi: https://pypi.org/pypi/city2graph/json (fetched 2026-08-29T10:54:28.257797+00:00, sha 547a44e4bcf2)
- Data as of 2026-08-30T08:39:29.467469+00:00.
