Zing Forum

Reading

City2Graph: A Powerful Tool for Transforming Geospatial Data into Graph Neural Networks

City2Graph is an open-source tool focused on graph-structuring geospatial data. It can convert urban spatial relationships into graph data formats suitable for graph neural networks (GNNs) and network analysis, providing a data foundation for smart city and geospatial AI applications.

图神经网络地理空间数据智慧城市GIS网络分析开源工具
Published 2026-05-04 06:45Recent activity 2026-05-04 06:51Estimated read 5 min
City2Graph: A Powerful Tool for Transforming Geospatial Data into Graph Neural Networks
1

Section 01

City2Graph: An Open-Source Tool Connecting Geospatial Data and Graph Neural Networks

City2Graph is an open-source tool focused on graph-structuring geospatial data, aiming to bridge the gap between geospatial data and graph neural networks (GNNs). It can convert urban spatial relationships (such as road topology, POI associations, etc.) into standard graph data formats, providing a data foundation for smart city and geospatial AI applications, and addressing the limitations of traditional GIS in capturing complex spatial relationships and network topology.

2

Section 02

Project Background: Limitations of Traditional GIS and the Need for GNNs

Geospatial data is the core of smart cities, transportation planning, and other fields. However, traditional GIS focuses on spatial geometry and attribute queries, making it difficult to capture complex spatial relationships and network topology. With the excellent performance of GNNs in relational modeling tasks, the demand for converting geospatial data into graph structures has become increasingly urgent, leading to the birth of City2Graph.

3

Section 03

Technical Principles: Graph Construction Logic for Nodes and Edge Relationships

The core of City2Graph lies in its built-in spatial relationship recognition and graph construction algorithms. Nodes support entities such as POIs, geographic regions, and infrastructure, carrying attributes like location and category. Edge relationships include types like topological adjacency, distance proximity, functional association, and network connectivity, which can be combined to form multi-relational graphs to capture complex spatial semantics.

4

Section 04

Application Scenarios: Covering Transportation, Functional Analysis, and Disaster Response

City2Graph's application scenarios include: 1. Urban transportation planning: Road network graph structures are used for traffic flow prediction, congestion detection, and optimal path planning; 2. Urban functional analysis: POI graph structures help mine spatial patterns (such as functional zone identification and change tracking); 3. Disaster emergency response: Graphs of resources and affected areas assist in optimal resource allocation and intelligent recommendations.

5

Section 05

GNN Integration: Compatible with Mainstream Frameworks and Supports Multiple Tasks

The graph data output by City2Graph is compatible with mainstream GNN frameworks such as PyTorch Geometric, DGL, and NetworkX. It supports tasks like node classification (e.g., POI category prediction using GCN/GAT) and link prediction (e.g., regional association prediction), providing high-quality input for downstream models.

6

Section 06

Data Interoperability: Supports Multi-Source Input and Flexible Output

City2Graph processes input in GIS formats like Shapefile and GeoJSON, unifying heterogeneous data representations. Its output supports formats such as adjacency lists, edge lists, and sparse matrices. It interoperates with GIS software like QGIS and ArcGIS, allowing users to preprocess data in a familiar environment before importing for conversion, thus reducing learning costs.

7

Section 07

Open-Source Ecosystem and Future Directions

As an open-source project, City2Graph relies on community collaboration and supports contributions from experts in multiple fields. It faces challenges such as scale (large-scale graph processing), dynamics (temporal updates), and semantic richness (incorporating domain knowledge). Future directions include supporting more data sources, optimizing performance, enriching analysis functions, and deeply integrating GNN models.