c2g-dev/city2graph

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

What it solves

City2Graph solves the difficulty of converting complex geospatial data—such as buildings, streets, and public transport feeds—into graph structures that can be used for network analysis and Graph Neural Networks (GNNs). It bridges the gap between geospatial libraries like GeoPandas and machine learning frameworks like PyTorch Geometric.

How it works

The library transforms various urban data sources into spatial and heterogeneous graphs. It supports the ingestion of data from OpenStreetMap, Overture Maps, GTFS (public transport) and GBFS (shared mobility) feeds, and origin-destination matrices. It creates connections based on morphology, proximity (e.g., KNN, Delaunay), and contiguity (e.g., queen/rook), using various distance metrics like Euclidean or Manhattan.

Who it’s for

It is designed for urban researchers, geospatial data scientists, and AI researchers focusing on urban systems and network analysis using GNNs.

Highlights

  • Heterogeneous Graphs: Supports multiple node and edge types within a single graph to represent complex urban relations.
  • GNN Integration: Provides round-trip conversion between GeoDataFrames, NetworkX, and PyTorch Geometric Data/HeteroData tensors.
  • Diverse Data Support: Handles everything from building morphology and street networks to public transport feeds and mobility flow data.
  • Proximity Analysis: Built-in support for various spatial graph generation methods including KNN and Delaunay graphs.

관련

  • 프로젝트
  • 프로젝트
  • 프로젝트
  • 프로젝트
  • 프로젝트