geostatistics¶
Geostatistical analysis and visualisation of traffic patterns.
geostatistics
¶
Geostatistical analysis and visualisation of traffic patterns.
Provides spatial statistics, hotspot classification, a spatial- autocorrelation proxy, and a full suite of publication-ready figures.
load_city_data
¶
Load all time-period GeoPackages for a single city.
Source code in src/trafficpipeline/geostatistics.py
load_all_cities
¶
spatial_statistics
¶
Compute descriptive spatial statistics for column.
Source code in src/trafficpipeline/geostatistics.py
hotspot_classification
¶
Classify segments into congestion categories.
Returns (class_counts, class_pct).
Source code in src/trafficpipeline/geostatistics.py
spatial_autocorrelation_proxy
¶
Compute a KNN-based spatial clustering indicator.
Returns (correlation, gdf_with_local_mean).
Source code in src/trafficpipeline/geostatistics.py
plot_city_traffic_maps
¶
Create an 8-panel traffic-intensity map for one city.
Source code in src/trafficpipeline/geostatistics.py
plot_temporal_pattern
¶
Bar chart comparing mean jam factor across time periods for all cities.
Source code in src/trafficpipeline/geostatistics.py
plot_congestion_distribution
¶
Histogram of jam-factor distributions per city.
Source code in src/trafficpipeline/geostatistics.py
plot_congestion_hotspots
¶
Side-by-side intensity + hotspot classification map.
Source code in src/trafficpipeline/geostatistics.py
plot_boxplot_comparison
¶
Boxplot of jam factor by city and time period.
Source code in src/trafficpipeline/geostatistics.py
generate_statistics_report
¶
Create and save a plain-text statistics report.
Source code in src/trafficpipeline/geostatistics.py
run_analysis
¶
Run the full geostatistical analysis pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_dir
|
str | Path
|
Project root containing the per-period aggregated GeoPackages. |
'.'
|
figures_dir
|
str | Path
|
Output directory for plotted figures. |
'figures'
|
output_dir
|
str | Path | None
|
Output directory for the textual statistics report. Defaults to
|
None
|