A comprehensive analysis tool for bicycle accidents in Germany using official Unfallatlas data (2016-2024). Features interactive web interface, temporal trend analysis, and geographic visualization.
- Streamlit Web App: Modern, interactive web interface (recommended)
- GUI Application: Traditional desktop interface with Tkinter
- Command Line: Scriptable interface for automation
- Load and process traffic accident data from German Unfallatlas (2016-2024)
- Advanced filtering by accident type, severity, time, and lighting conditions
- Interactive maps with color-coded severity indicators
- Temporal trend analysis showing changes over 9 years
- Seasonal and day-of-week pattern analysis
- Statistical dashboards with exportable data
- Geographic: Select analysis areas with GPS coordinates and dimensions
- Temporal: Filter by year range, hour of day, month, day of week
- Severity: Filter by accident outcomes (fatal, serious injury, light injury)
- Accident Type: Filter by collision types (pedestrian, oncoming traffic, etc.)
- Environmental: Filter by lighting conditions (daylight, twilight, darkness)
- Python 3.8+
- Internet connection (for map tiles)
- Clone the repository
git clone https://github.com/yourusername/UnfallAtlasBicycleAccidentAnalyzer.git
cd UnfallAtlasBicycleAccidentAnalyzer- Install dependencies
pip install -r requirements.txt- Download data (place in
data/folder)
- Download German Unfallatlas data from Statistische Ämter des Bundes und der Länder
- Place zip files in
data/folder (see Data Requirements)
streamlit run streamlit_app.py- Open browser to
http://localhost:8501 - Select location and filters in sidebar
- Explore interactive maps and trend analysis
python accident_analyzer.py- Click "Load Accident Data"
- Enter coordinates and area dimensions
- Click "Analyze and Plot"
python accident_analyzer.py --cliFollow prompts for coordinates and area dimensions.
- Color-coded markers by accident severity (🔴 fatal, 🟠 serious, 🟡 light)
- Hover details with accident information
- Multiple map styles (OpenStreetMap, Satellite imagery)
- Real-time filtering with instant map updates
- 9-year temporal trends (2016-2024)
- Seasonal patterns and monthly distributions
- Day-of-week analysis for targeted safety campaigns
- Before/after comparisons for policy impact assessment
- CSV export of filtered datasets
- Interactive charts with Plotly
- Statistical summaries for reports
Place these files in the data/ folder:
data/
├── Unfallorte2016_EPSG25832_CSV.zip
├── Unfallorte2017_EPSG25832_CSV.zip
├── Unfallorte2018_EPSG25832_CSV.zip
├── Unfallorte2019_EPSG25832_CSV.zip
├── Unfallorte2020_EPSG25832_CSV.zip
├── Unfallorte2021_EPSG25832_CSV.zip
├── Unfallorte2022_EPSG25832_CSV.zip
├── Unfallorte2023_EPSG25832_CSV.zip
└── Unfallorte2024_EPSG25832_CSV.zip
Data Source: German Unfallatlas
Note: The tool handles format inconsistencies between years automatically (2016-2019 use
.txtfiles incsv/folders, 2020-2024 use direct.csvfiles).
Pre-configured coordinates for major German cities:
- Munich: 48.1351, 11.5820
- Augsburg: 48.3661, 10.8985
- Berlin: 52.5200, 13.4050
- Hamburg: 53.5511, 9.9937
- Core:
AccidentAnalyzerclass for data processing - Frontend: Streamlit web app with Plotly visualizations
- Legacy: Tkinter GUI and CLI interfaces
- Coordinate Systems: WGS84 ↔ UTM Zone 32N (EPSG:25832)
- Format Handling: Automatic detection of CSV/TXT formats
- Performance: Optimized for datasets with 300K+ records
- Core: pandas, numpy, pyproj, plotly
- Mapping: geopandas, contextily (legacy), streamlit-folium (web)
- UI: streamlit, tkinter (built-in)
- Large datasets: 300K+ bicycle accidents across 9 years
- Memory usage: ~500MB RAM for full dataset
- Rendering: Interactive maps handle 10K+ points efficiently
- Network: Internet required for map tiles
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Data: Statistische Ämter des Bundes und der Länder
- Maps: OpenStreetMap contributors
- Libraries: Streamlit, Plotly, GeoPandas communities
For questions or issues:
- Open an issue
- Check existing documentation
- Review the data format guide