cityImage.simplify_graph#
- cityImage.simplify_graph(nodes_gdf, edges_gdf, nodes_to_keep_regardless=[])[source]#
The function identify pseudo-nodes, namely nodes that represent intersection between only 2 segments. The segments geometries are merged and the node is removed from the nodes_gdf GeoDataFrame.
- Parameters:
nodes_gdf (Point GeoDataFrame) – The nodes (junctions) GeoDataFrame.
edges_gdf (LineString GeoDataFrame) – The street segments GeoDataFrame.
nodes_to_keep_regardless (list) – List of nodeIDs representing nodes to keep, even when pseudo-nodes (e.g. stations, when modelling transport networks).
- Returns:
nodes_gdf, edges_gdf – The cleaned junctions and street segments GeoDataFrames.
- Return type:
tuple of GeoDataFrames