cityImage.weight_nodes#
- cityImage.weight_nodes(nodes_gdf, services_gdf, G, field_name, radius=400)[source]#
Given a nodes’ and a services/points’ GeoDataFrame, the function assigns an attribute to nodes in the graph G (prevously derived from nodes_gdf) based on the amount of features in the services_gdf in a buffer around each node.
The measure contemplates the assignment of attributes (e.g. number of activities, population, employees in an area) to nodes and accounts for opportunities that are reachable along the actual street network as perceived by pedestrians’. The reach centrality of a node j, indicates the number of other nodes reachable from i, at the shortest path distance of r, where nodes are rewarded with a score (indicated by “attribute”) which indicates their importance. The function is readapted from: Sevtsuk, A. & Mekonnen, M., 2012. Urban Network Analysis: A New Toolbox For ArcGIS. Revue internationale de géomatique, 2, pp.287–305.
- Parameters:
nodes_gdf (Point GeoDataFrame) – nodes (junctions) GeoDataFrame.
services_gdf (Point GeoDataFrame) –
G (Networkx graph) – The street network graph.
field_name (string) – The name of the nodes’ attribute.
radius (float) – Distance around the node within looking for point features (services).
- Returns:
G – The updated street network graph.
- Return type:
Networkx graph