Add node_geom_col and set_point_nodes in contiguity graph and group_nodes#95
Merged
yu-ta-sato merged 6 commits intoc2g-dev:mainfrom Dec 28, 2025
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request introduces enhanced flexibility for controlling node geometries in proximity and contiguity graph construction functions within
city2graph/proximity.py. The main improvements allow users to specify custom point geometries for polygon nodes (instead of always using centroids), and to optionally swap polygon geometries for points while preserving the original shapes.The most important changes are:
API Enhancements: Polygon Node Geometry Control
node_geom_colandset_point_nodesparameters togroup_nodesandcontiguity_graph, allowing users to specify a custom column of point geometries for nodes and to swap polygon geometries for points while preserving original geometries. [1] [2] [3] [4]Edge Construction Logic
_edges_gdf_from_pairsto accept custom polygon node positions for accurate edge geometry and weight calculation when node geometries are overridden. [1] [2]Graph Metadata
Testing and Validation
group_nodesandcontiguity_graph. [1] [2]These changes provide more control and transparency over how spatial graphs are constructed, making the API more flexible for advanced spatial analysis workflows.
Related Issues
NA
Checklist