This project uses Support Vector Machines (SVM) to classify pedestrian-friendly areas in Cologne, Germany, based on real-world data fetched from OpenStreetMap (OSM). The analysis incorporates pedestrian, traffic, and cycleway routes and visualizes the decision boundary, feature importance, and routes on a map.
- Overview
- Data Sources
- Features
- Installation
- Usage
- Visualizations
- Results
- Contributing
- License
The data for this project is fetched directly from OpenStreetMap using the osmnx library. Key data includes:
- Pedestrian routes (highway=footway, highway=pedestrian, highway=path)
- Traffic roads (highway=motorway, highway=primary, highway=secondary, highway=tertiary)
- Cycleways (highway=cycleway)
- Fetch Data from OpenStreetMap: Retrieves all pedestrian routes, traffic roads, and cycleways for Cologne.
- Simulated Neighborhood Data: Generates 100 data points with realistic variations for training.
- SVM Model: Trains a linear SVM model on the scaled dataset.
- Visualization: Visualizes the SVM decision boundary, maps routes, and displays feature importance.
git clone https://github.com/your-username/pedestrian-friendly-cologne.git
cd pedestrian-friendly-colognepip install -r requirements.txtRun the script to generate the visualizations and results:
python pedestrian_analysis.pyThe script fetches data from OpenStreetMap, simulates neighborhood data, trains an SVM model, and generates visualizations.
This project generates the following visualizations:
- SVM Decision Boundary: Displays the classification of pedestrian-friendly areas.
- Confusion Matrix: Evaluates the model's performance.
- Feature Importance Plot: Highlights the most influential features in the SVM model.
- Pedestrian Routes Map: Visualizes pedestrian, traffic, and cycleway routes in Cologne.
The SVM model provides the following outputs:
- Classification Accuracy: Evaluated using a confusion matrix.
- Feature Importance: Determines which features most impact the pedestrian-friendly classification.
- Visual Map: Displays Cologne's pedestrian routes alongside traffic and cycleways.
Contributions are welcome! If you have ideas for improvement or find any issues, feel free to:
- Fork the repository.
- Create a new branch for your feature or fix.
- Submit a pull request.
This project is licensed under the MIT License.