bottleneck¶
Road-capacity bottleneck analysis via OSMnx.
bottleneck
¶
Road-capacity bottleneck analysis via OSMnx.
Tests whether congestion occurs at capacity-constrained segments using graph-based capacity-drop detection, local capacity gradients, and aggregate low-vs-high capacity comparisons.
get_road_capacity
¶
Download road network and compute capacity attributes.
Returns (edges_filtered, G_filtered) where edges are limited
to HERE-comparable road types.
Source code in src/trafficpipeline/bottleneck.py
detect_capacity_drops
¶
Find graph nodes where incoming capacity exceeds outgoing by >=threshold.
Returns (drop_nodes, drop_magnitudes, drop_coords).
Source code in src/trafficpipeline/bottleneck.py
analyze_capacity_drop_congestion
¶
Test proximity to capacity drops and local capacity gradient.
Source code in src/trafficpipeline/bottleneck.py
compute_peak_sensitivity
¶
Load evening-peak and night data and compute sensitivity metrics.
Source code in src/trafficpipeline/bottleneck.py
spatial_join_traffic_roads
¶
Join traffic segments to road edges by nearest-centroid.
Source code in src/trafficpipeline/bottleneck.py
analyze_city
¶
Run the complete bottleneck analysis for one city.
Returns (matched_gdf, results_dict).
Source code in src/trafficpipeline/bottleneck.py
plot_results
¶
Generate bottleneck figures and save CSV summary.
Source code in src/trafficpipeline/bottleneck.py
run_analysis
¶
Run bottleneck analysis for all cities.