SafePath
A data product that recommends the safest route to walk between two points in London based on one year of Met Police data
Data Product
2 months
2024
R - R Shiny
Objective:
This project focuses on developing a data product that aids users in navigating London safely by optimizing routes based on real-time and historical crime data. The system integrates descriptive, predictive, and prescriptive analytics to provide actionable insights for route safety, emphasizing user interactivity, efficiency, and scalability.
Key Design Features:
Interactive Map-Based Interface:
Users can input start and end locations, visualizing multiple routes overlaid on a map styled with CartoDB Positron tiles.
A heatmap highlights high-crime areas for situational awareness.
Safety Scoring:
Routes are ranked based on a safety score that incorporates crime proximity, recency, and severity.
Spatial operations using
sf
ensure efficient geospatial processing.
Real-Time Data Integration:
The system fetches route data dynamically via the OpenRouteService API.
Crime data is processed monthly, ensuring up-to-date insights.
Dynamic Visualizations:
Heatmaps, route polylines, and interactive tables present data intuitively.
Color-coded routes and pop-ups provide detailed route summaries, including distance, duration, and safety scores.
Scalability:
Modular design allows adaptation to other cities or datasets with minimal changes.
Efficient spatial joins and buffered operations ensure performance with large datasets.
Design Process:
Requirement Analysis:
Identified user needs: safety prioritization, route visualization, and ease of use.
Defined goals for interactivity and efficiency.
Data Acquisition and Preprocessing:
Crime datasets from multiple months were merged and cleaned, retaining relevant columns (Month, Latitude, Longitude, Crime type).
Recency weights were computed for predictive analytics.
Back-End Development:
Implemented geospatial operations using
sf
for proximity analysis and risk scoring.API integration with OpenRouteService to fetch routing data and provide alternative paths.
Front-End Development:
Designed an intuitive Shiny interface with responsive elements.
Interactive features include search inputs, dynamic tables, and map overlays (heatmaps, routes).
Testing and Validation:
Validated accuracy of safety scores and ensured robustness against edge cases (e.g., missing data).
Performance optimized for real-time updates with large datasets.
Deployment:
The modular structure ensures easy deployment and adaptability to other regions or environments.