cityImage.districts_to_edges_from_nodes#

cityImage.districts_to_edges_from_nodes(nodes_gdf, edges_gdf, column)[source]#

It assigns districts’ identifiers to the street segments (edges), when the districts are assigned to the junctions(nodes), i.e. communities are identified on the primal graph. The attribution is based on Euclidean distance from each node to the closest street segment. Three values are assigned to each edge: - district_u: An integer representing the district identifier for the starting node of the edge. - district_v: An integer representing the district identifier for the ending node of the edge. - district_uv: An integer representing the district identifier for the edge, when district_u == district_v.

Parameters:
  • nodes_gdf (Point GeoDataFrame) – The nodes (junctions) GeoDataFrame.

  • edges_gdf (LineString GeoDataFrame) – The street segments GeoDataFrame.

  • column (string) – The name of the column containing the district identifier.

Returns:

edges_gdf – The updated street segments GeoDataFrame.

Return type:

LineString GeoDataFrame