Uncovering Intersections: Analyzing Intersection Density

In our quest to understand walkability, identifying intersections within the pedestrian network is a key element. This section introduces a function that checks the degree of nodes in the network, providing insights into the density of intersections within the city's boundaries.

Analyzing Intersection Density

The following Python function, find_intersection_density(graph, sq_km_area), takes the pedestrian network graph (graph) and the area of the city's boundary in square kilometers (sq_km_area) as inputs. Let's break down the code:

	
### The code below will check how many nodes are of degree > 2
### The degree of a node is the number of edges connected to the node
def find_intersection_density(graph,sq_km_area):
	intersection_count = 0

	# Iterate through nodes and check if they are intersections (degree > 2)
	for node in graph.nodes():
		if len(list(graph.successors(node))) > 2 or len(list(graph.predecessors(node))) > 2:
			intersection_count += 1

	print(f"Total number of intersection nodes: {intersection_count}")

	intersection_density = intersection_count / sq_km_area
	print(f"Total intersection density (number of intersections network per sq. km): {intersection_density}")

	return intersection_density
	
	
intersection_density = find_intersection_density(G,gdf_area_square_km)



Total number of intersection nodes: 133291
Total intersection density (number of intersections network per sq. km): 200.41294887127754

	

Understanding the Function

  1. Node Degree Check: The function iterates through each node in the network and checks whether the degree (number of connected edges) is greater than 2. Nodes with a degree greater than 2 are considered intersections.
  2. Counting Intersections: The total number of intersection nodes is tallied, providing insights into the density of intersections within the city.
  3. Intersection Density: The intersection density is then calculated by dividing the total number of intersection nodes by the area of the city's boundary in square kilometers. This metric indicates the number of intersections per square kilometer.

Implications for Walkability

Assessing intersection density is pivotal for understanding the complexity of pedestrian pathways. Higher intersection density often implies a more interconnected and accessible urban environment.