c2g-dev/city2graph
Transform geospatial relations into graphs for Graph Neural Networks and network analysis
16 Releases
Latest: 6d ago
v0.4.0Latest
✨ Added
- Added a `directed` parameter to `gdf_to_pyg()`. With the new default `directed=False`, each edge `(u, v)` is symmetrized by adding the reverse edge `(v, u)` so PyTorch Geometric receives a proper undirected graph, and `pyg_to_gdf()` deduplicates the edges back to the original rows on reconstruction. For heterogeneous graphs, `directed` also accepts a per-edge-type dictionary. Related PRs: [[#157](https://github.com/c2g-dev/city2graph/pull/157)](https://github.com/c2g-dev/city2graph/pull/157)
- Added a `reverse_edge_types` parameter to `gdf_to_pyg()` for undirected cross-type heterogeneous edges: `"auto"` generates `(dst_type, "rev_<relation>", src_type)` stores for message passing, a dict provides explicit mappings, and `None` enables strict mode. Related PRs: [[#157](https://github.com/c2g-dev/city2graph/pull/157)](https://github.com/c2g-dev/city2graph/pull/157)
- Added a `multigraph` parameter to `gdf_to_pyg()` that promotes two-level edge indexes to a keyed `(source, target, key)` contract so parallel edges round-trip exactly, and extended `nx_to_pyg()` / `pyg_to_nx()` to infer directionality from the NetworkX graph type and to preserve `MultiGraph` / `MultiDiGraph` edge keys. Related PRs: [[#157](https://github.com/c2g-dev/city2graph/pull/157)](https://github.com/c2g-dev/city2graph/pull/157)
- Added `canonicalize_edges()` to collapse reciprocal `(u, v)` / `(v, u)` rows and parallel duplicates in edge GeoDataFrames (`duplicates="first" | "key" | "error"`), and `symmetrize_edges()` as its idempotent inverse, appending reverse rows with reversed geometries. Related PRs: [[#157](https://github.com/c2g-dev/city2graph/pull/157)](https://github.com/c2g-dev/city2graph/pull/157), [[#168](https://github.com/c2g-dev/city2graph/pull/168)](https://github.com/c2g-dev/city2graph/pull/168)
- Added a `duplicate_edges` parameter to the proximity generators (`knn_graph()`, `delaunay_graph()`, `gabriel_graph()`, `relative_neighborhood_graph()`, `euclidean_minimum_spanning_tree()`, `fixed_radius_graph()`, `waxman_graph()`, `contiguity_graph()`) and the morphology functions to optionally emit both `(u, v)` and `(v, u)` rows per undirected edge. Related PRs: [[#168](https://github.com/c2g-dev/city2graph/pull/168)](https://github.com/c2g-dev/city2graph/pull/168)
- Added `extent_buffer`, `limit`, and `include_unenclosed_buildings` parameters to `morphological_graph()`, a `max_connection_distance` parameter to `place_to_movement_graph()`, and a `limit` parameter to `create_tessellation()` (auto-computed as a buffered convex hull when omitted, so buildings near outer street loops are no longer dropped). Related PRs: [[#164](https://github.com/c2g-dev/city2graph/pull/164)](https://github.com/c2g-dev/city2graph/pull/164)
- Added a `directed` parameter to `segments_to_graph()`; `directed=False` canonicalizes each edge to an unordered `(min, max)` node-id order so reverse-drawn duplicate segments become parallel edges of one unordered pair. Related PRs: [[#165](https://github.com/c2g-dev/city2graph/pull/165)](https://github.com/c2g-dev/city2graph/pull/165)
📋 Changed
- Breaking: `gdf_to_pyg()` now treats edges as undirected by default and validates them: edge tables containing both `(u, v)` and `(v, u)` rows (typical of OSMnx-style directed sources), or parallel rows for the same unordered pair, raise a `ValueError` pointing to `canonicalize_edges()`, `multigraph=True`, or `directed=True` as remedies. Pass `directed=True` to restore the previous as-is behavior. Related PRs: [[#157](https://github.com/c2g-dev/city2graph/pull/157)](https://github.com/c2g-dev/city2graph/pull/157)
- Breaking: Renamed the morphology terminology from "private"/"public" to "place"/"movement". Node keys are now `"place"` and `"movement"`; edge types are `("place", "touched_to", "place")`, `("movement", "connected_to", "movement")`, and `("place", "faced_to", "movement")`; identifier columns are `place_id`, `movement_id`, `from_place_id`/`to_place_id`, and `from_movement_id`/`to_movement_id`. Related PRs: [[#169](https://github.com/c2g-dev/city2graph/pull/169)](https://github.com/c2g-dev/city2graph/pull/169)
- Breaking: `segments_to_graph()` now defaults to `multigraph=True`, returning a three-level `(from_node_id, to_node_id, edge_key)` MultiIndex (and an `nx.MultiGraph` when `as_nx=True`). With `multigraph=False`, duplicate node pairs now raise a `ValueError` instead of silently returning a duplicated MultiIndex. Related PRs: [[#165](https://github.com/c2g-dev/city2graph/pull/165)](https://github.com/c2g-dev/city2graph/pull/165)
- Updated dependencies, including `requests` 2.33.0, `aiohttp` 3.14.0, `pillow` 12.2.0, `pytest` 9.0.3, `nbconvert` 7.17.1, and `codecov/codecov-action` v7. Related PRs: [[#147](https://github.com/c2g-dev/city2graph/pull/147)](https://github.com/c2g-dev/city2graph/pull/147), [[#148](https://github.com/c2g-dev/city2graph/pull/148)](https://github.com/c2g-dev/city2graph/pull/148), [[#149](https://github.com/c2g-dev/city2graph/pull/149)](https://github.com/c2g-dev/city2graph/pull/149), [[#151](https://github.com/c2g-dev/city2graph/pull/151)](https://github.com/c2g-dev/city2graph/pull/151), [[#152](https://github.com/c2g-dev/city2graph/pull/152)](https://github.com/c2g-dev/city2graph/pull/152), [[#153](https://github.com/c2g-dev/city2graph/pull/153)](https://github.com/c2g-dev/city2graph/pull/153), [[#158](https://github.com/c2g-dev/city2graph/pull/158)](https://github.com/c2g-dev/city2graph/pull/158), [[#159](https://github.com/c2g-dev/city2graph/pull/159)](https://github.com/c2g-dev/city2graph/pull/159), [[#160](https://github.com/c2g-dev/city2graph/pull/160)](https://github.com/c2g-dev/city2graph/pull/160), [[#162](https://github.com/c2g-dev/city2graph/pull/162)](https://github.com/c2g-dev/city2graph/pull/162), [[#163](https://github.com/c2g-dev/city2graph/pull/163)](https://github.com/c2g-dev/city2graph/pull/163)
🗑️ Deprecated
- Deprecated `private_to_private_graph()`, `private_to_public_graph()`, and `public_to_public_graph()` in favor of `place_to_place_graph()`, `place_to_movement_graph()`, and `movement_to_movement_graph()`. The old names emit a `DeprecationWarning` and will be removed in a future major release. Related PRs: [[#169](https://github.com/c2g-dev/city2graph/pull/169)](https://github.com/c2g-dev/city2graph/pull/169)
🐛 Fixed
- Fixed a `UnicodeDecodeError` in `load_overture_data()` when reading back files saved with `save_to_file=True`, by @Jah-yee. Related PRs: [[#161](https://github.com/c2g-dev/city2graph/pull/161)](https://github.com/c2g-dev/city2graph/pull/161)
- Made enclosed tessellation more robust: boundary-simplification failures retry with `simplify=False`, and GEOS topology errors retry with a coarser `grid_size` before falling back gracefully. Related PRs: [[#164](https://github.com/c2g-dev/city2graph/pull/164)](https://github.com/c2g-dev/city2graph/pull/164)
- Fixed `segments_to_graph()` ignoring `as_nx=True` for empty inputs, and `segments_to_graph(multigraph=True, as_nx=True)` silently collapsing parallel edges by returning an `nx.Graph` instead of an `nx.MultiGraph`. Related PRs: [[#165](https://github.com/c2g-dev/city2graph/pull/165)](https://github.com/c2g-dev/city2graph/pull/165)
- Fixed `load_gtfs()` UDF registration against newer DuckDB releases and guarded `get_od_pairs()` against an empty calendar table. Related PRs: [[#170](https://github.com/c2g-dev/city2graph/pull/170)](https://github.com/c2g-dev/city2graph/pull/170)
✨ New Contributors
- @Jah-yee made their first contribution in https://github.com/c2g-dev/city2graph/pull/161
- Full Changelog: https://github.com/c2g-dev/city2graph/compare/v0.3.1...v0.4.0
v0.3.1
📋 What's Changed
- Refreshed locked dependencies in `uv.lock` by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/142
- Fixed duplicated undirected metapaths in `add_metapaths()` and `add_metapaths_by_weight()` when `directed=False`, with added regression coverage for GeoDataFrame and NetworkX outputs, by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/143
- Updated the documentation and example notebooks, including the DuckDB-based GTFS workflow and Overture Maps walkthroughs, by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/144
- Full Changelog: https://github.com/c2g-dev/city2graph/compare/v0.3.0...v0.3.1
v0.3.0
📋 What's Changed
- `v0.3.0` focuses on transit workflows, isochrone generation, and correctness fixes across geospatial loading and graph construction.
✨ Added
- Added DuckDB-backed GTFS loading through `load_gtfs()`, enabling SQL-first transit workflows with an in-memory database connection, and expanded transportation support with directed and frequency-aware summaries. Related PRs: [#134](https://github.com/c2g-dev/city2graph/pull/134)
- Added support for multiple center points and multi-threshold layered output in `create_isochrone()` and `filter_graph_by_distance()`, making accessibility analysis more flexible for multi-origin scenarios. Related PRs: [#136](https://github.com/c2g-dev/city2graph/pull/136), [#139](https://github.com/c2g-dev/city2graph/pull/139)
📋 Changed
- Reworked the GTFS transportation pipeline to use DuckDB tables instead of materialized DataFrame dictionaries, and fixed station-sequence handling along the way. Related PRs: [#134](https://github.com/c2g-dev/city2graph/pull/134)
- Improved concave-hull isochrone generation defaults and internal performance for more stable polygon output, while broadening isochrone APIs to support richer inputs. Related PRs: [#136](https://github.com/c2g-dev/city2graph/pull/136), [#139](https://github.com/c2g-dev/city2graph/pull/139)
- Updated dependencies, including security- and maintenance-related upgrades, and switched the `overturemaps` dependency source from a Git reference to the published package release. Related PRs: [#133](https://github.com/c2g-dev/city2graph/pull/133), [#135](https://github.com/c2g-dev/city2graph/pull/135)
🐛 Fixed
- Fixed `clip_graph()` CRS alignment and strict clipping of out-of-boundary endpoints, and fixed `load_overture_data()` so clipped and post-processed outputs are correctly written back to disk when saving files. Related PRs: [#137](https://github.com/c2g-dev/city2graph/pull/137), [#138](https://github.com/c2g-dev/city2graph/pull/138)
- Fixed native ID handling and empty building-join edge cases in `morphological_graph()`. Related PRs: [#124](https://github.com/c2g-dev/city2graph/pull/124)
- Fixed heterogeneous PyG conversion edge handling, metapath empty-frame construction, and `plot_graph()` style kwargs forwarding. Related PRs: [#122](https://github.com/c2g-dev/city2graph/pull/122), [#135](https://github.com/c2g-dev/city2graph/pull/135)
📝 Documentation
- Updated project URLs and release metadata, refreshed installation and contributor guidance, and added a new blog post alongside the `v0.3.0` documentation updates. Related PRs: [#120](https://github.com/c2g-dev/city2graph/pull/120), [#126](https://github.com/c2g-dev/city2graph/pull/126), [#140](https://github.com/c2g-dev/city2graph/pull/140)
- Full Changelog: https://github.com/c2g-dev/city2graph/compare/v0.2.4...v0.3.0
v0.2.4
📋 What's Changed
- Add Nominatim API for `load_overture_data` by a parameter `place_name` by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/115
- Security update for CVE-2025-3730 and CVE-2025-2953 by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/117
- Fixed site url by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/107
- Update pre-commit and test by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/109
- Update robots.txt by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/110
- Update docs by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/111
- Add 'meta' markdown extension to configuration by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/112
- Update docs for mkdocs & readthedocs optimization by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/113
- + 4 more
v0.2.3
📋 What's Changed
- Fixed robots.txt by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/103
- Fix edge_feature_cols in gdf_to_pyg and by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/104
- Update v0.2.2 -> v0.2.3 by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/105
- Full Changelog: https://github.com/c2g-dev/city2graph/compare/v0.2.2...v0.2.3
v0.2.2
📋 What's Changed
- Add support for extracting additional node/edge attributes during gra… by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/100
- Update docs to v0.2.2 by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/101
- Full Changelog: https://github.com/c2g-dev/city2graph/compare/v0.2.1...v0.2.2
v0.2.1
📋 What's Changed
- Fix redirect from index.html by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/90
- Bump astral-sh/setup-uv from 5 to 7 by @dependabot[bot] in https://github.com/c2g-dev/city2graph/pull/91
- Bump actions/cache from 4 to 5 by @dependabot[bot] in https://github.com/c2g-dev/city2graph/pull/92
- Bump actions/checkout from 4 to 6 by @dependabot[bot] in https://github.com/c2g-dev/city2graph/pull/93
- Bump actions/setup-python from 5 to 6 by @dependabot[bot] in https://github.com/c2g-dev/city2graph/pull/94
- Add `node_geom_col` and `set_point_nodes` in `contiguity graph` and `group_nodes` by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/95
- Restucture public API documents by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/96
- Update documents for v0.2.1 by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/97
- + 2 more
v0.2.0
📋 What's Changed
- Add rustworkx support by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/62
- Refactor `proximity.py` by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/63
- Add `source_node_types` and `target_node_types` in the params of `bridge_nodes` by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/64
- Add `add_metapaths_by_weights` by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/65
- Fix issues in proximity graph with a new parameter network_weight. by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/66
- Add plot_graph by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/68
- Refactor utils.py and tests by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/69
- Bump actions/checkout from 5 to 6 by @dependabot[bot] in https://github.com/c2g-dev/city2graph/pull/67
- + 18 more
v0.1.7
📋 What's Changed
- DOCS: Update docs by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/50
- Add dependabot.yaml by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/51
- Fix type for time by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/52
- Bump astral-sh/setup-uv from 6 to 7 by @dependabot[bot] in https://github.com/c2g-dev/city2graph/pull/54
- Bump actions/setup-python from 5 to 6 by @dependabot[bot] in https://github.com/c2g-dev/city2graph/pull/53
- Potential fix for code scanning alert no. 2: Workflow does not contain permissions by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/55
- DOC: Update docs by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/56
- Bump actions/upload-artifact from 4 to 5 by @dependabot[bot] in https://github.com/c2g-dev/city2graph/pull/57
- + 3 more
✨ New Contributors
- @dependabot[bot] made their first contribution in https://github.com/c2g-dev/city2graph/pull/54
- Full Changelog: https://github.com/c2g-dev/city2graph/compare/v0.1.6...v0.1.7
v0.1.6
📋 What's Changed
- ENH: Add `add_metapath` by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/43
- Refactor test codes and adjusted sources by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/44
- Update documents for v0.1.6 by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/45
- Full Changelog: https://github.com/c2g-dev/city2graph/compare/v0.1.5...v0.1.6
v0.1.5
📋 What's Changed
- Add `group nodes` by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/41
- Update version to v0.1.5 by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/42
- Full Changelog: https://github.com/c2g-dev/city2graph/compare/v0.1.4...v0.1.5
v0.1.4
📋 What's Changed
- ENH: Add `od_matrix_to_graph` by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/38
- FIX: Fixed typo by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/39
- DOC: Update docs for v0.1.4 by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/40
- Full Changelog: https://github.com/c2g-dev/city2graph/compare/v0.1.3...v0.1.4
v0.1.3
📋 What's Changed
- ENH: Add `contiguity_graph` by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/32
- FIX: Add logics of dealing with ids uniquely both for source and target in `_directed_graph` by @yu-ta-sato and @danialowen in https://github.com/c2g-dev/city2graph/pull/34
- FIX: Update weight calculation in `_directed_graph` by @yu-ta-sato and @danialowen in https://github.com/c2g-dev/city2graph/pull/35
- DOC: Update index.rst by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/25
- DOC: Update html title and metadata by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/26
- DOC: Add breadcrumbs by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/27
- DOC: Update install way by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/28
- DOC: Update notebook and document for `contiguity_graph` by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/33
- + 3 more
v0.1.2
📋 What's Changed
- FIX: Update ruff-pre-commit version by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/15
- DOC: Add PR and issue templates by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/16
- DOC: Update descriptions by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/17
- DOC: Add badges and update documents by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/18
- DOC: Fix html title by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/19
- Doc: fix morphological graph name and data type for edge index in public_to_public_graph by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/20
- ENH: Accept MultiGraph for morphological_graph and its relevant functions by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/21
- DOC: Add CHANGELOG.md by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/22
- + 3 more
v0.1.1
📋 What's Changed
- conda started been supported for the core dependencies
- citation is prepared
- DOC: update documents with correction and improved readability by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/6
- DOC: delete unnecessary documents by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/7
- DOC: update see also by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/8
- ENH: update package build and deploy by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/9
- ENH: update conda-forge support by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/10
- ENH: Add citation by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/11
- + 1 more
v0.1.0
📋 What's Changed
- Fix/documentation and formatting by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/1
- ENH: Add pre-commit to GitHub Actions by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/2
- FIX: Allow test.yml to skip no-commit-to-branch by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/3
- FIX: Modify build_and_deploy.yml to avoid skipping by @yu-ta-sato in https://github.com/c2g-dev/city2graph/pull/4
✨ New Contributors
- @yu-ta-sato made their first contribution in https://github.com/c2g-dev/city2graph/pull/1
- Full Changelog: https://github.com/c2g-dev/city2graph/commits/latest
