How wader444/road-accident-hotspot-detection works
This is a Python geospatial accident-hotspot analysis project. Its principal workflow extracts a city’s coordinates, clusters them with Haversine DBSCAN, and produces hotspot summaries and visualizations; K-Means provides a separate comparison. The graph also includes documented map serving and pipeline runners. Source excerpts establish the core clustering, preparation, analysis, comparison, and orchestration behavior; some visualization and runner relationships are documented in the README but their implementations were not sampled.
Main entry points: run_city.py City workflow runner · outputs DBSCAN results · main.py Downstream runner · analyze_hotspots.py Hotspot summary
Components 14
Data preparation
- City extraction
prepare_city.py - Prepared city records
outputs
Spatial clustering
- DBSCAN and sweep
clustering.py - DBSCAN results
outputs
Analysis and visualization
- Hotspot summary
analyze_hotspots.py - Hotspot exports
outputs - Interactive map
visualize_hotspots.py - K-Means comparison
compare_clustering.py - Comparison exports
outputs
Workflow runners
- Downstream runner
main.py - City workflow runner
run_city.py - Map server runner
run_map.py
Other components
- Raw accident CSV
- Analyst
Connections 20
- Raw accident CSV → City extraction: provides records
README.md - City extraction → Prepared city records: writes records
prepare_city.py - Prepared city records → DBSCAN and sweep: loads coordinates
clustering.py - DBSCAN and sweep → DBSCAN results: writes labels
clustering.py - DBSCAN results → Hotspot summary: loads results
analyze_hotspots.py - Hotspot summary → Hotspot exports: writes summaries
analyze_hotspots.py - DBSCAN results → K-Means comparison: loads assignments
compare_clustering.py - K-Means comparison → Comparison exports: writes comparison
compare_clustering.py - DBSCAN results → Interactive map: visualizes results
- Downstream runner → Hotspot summary: calls analysis
main.py - Downstream runner → Interactive map: creates map
main.py - Downstream runner → K-Means comparison: calls comparison
main.py - City workflow runner → City extraction: runs preparation
README.md - City workflow runner → DBSCAN and sweep: runs clustering
README.md - City workflow runner → Hotspot summary: regenerates summaries
README.md - City workflow runner → K-Means comparison: creates comparison
README.md - Map server runner → Interactive map: serves map
README.md - Analyst → City workflow runner: selects city
README.md - Analyst → Downstream runner: runs stages
README.md - Analyst → Map server runner: opens map
README.md