cityImage.clean_duplicate_nodes#
- cityImage.clean_duplicate_nodes(nodes_gdf, edges_gdf)[source]#
Removes duplicate nodes in a network based on coincident geometry, updating both nodes and edges GeoDataFrames.
Nodes with exactly matching geometries are considered duplicates and merged into a single node. All references to duplicate node IDs in the edges GeoDataFrame are updated to the retained node ID.
- Parameters:
nodes_gdf (GeoDataFrame) – Point GeoDataFrame containing network nodes (junctions).
edges_gdf (GeoDataFrame) – LineString GeoDataFrame containing street segments.
- Returns:
nodes_gdf (GeoDataFrame) – Cleaned nodes GeoDataFrame with duplicates removed.
edges_gdf (GeoDataFrame) – Edges GeoDataFrame with references to duplicate node IDs updated.