What’s your project called?
Beasts: Police Station Finder
What is your chosen problem statement?
Our chosen problem statement is Theme 3 Subtheme 1: Strengthening domestic security requires exploring solutions that utilize crime data analysis and patrol route optimization. Design a solution to seamlessly integrate crime hotspot analysis with patrol route optimization, allowing law enforcement agencies to prioritize higher crime risk areas and shorten emergency response times.
How does your hack answer the problem statement?
Our solution effectively addresses the problem statement by requiring input of the address where a crime has occurred. It then outputs the police stations that are nearest to it in terms of travel time. In situations where multiple crimes are happening simultaneously in the same area and one police station cannot handle all the incidents, our algorithm ensures efficient resource allocation. Each police station has a limit on the number of cases it can manage. If this limit is exceeded, the algorithm activates the next nearest police station to assist. This approach prevents situations where a manpower shortage at one station leads to longer emergency response times. By leveraging the Google Maps API, we optimize the route for the fastest possible response, ensuring that the emergency services arrive promptly.
How did you build your hack?
We built our hack using Python scripts and many libraries. We also used relevant datasets available online, such as the geojson of the Singapore map, the KML file of the police stations in Singapore, and past data on the number of cases dealt with by each police station from 2011 to 2021. We used a Python script (combine.py) to merge data from the KML and geojson files, creating a new geojson file containing both the geographical data of Singapore and the specific locations of the Police Stations. We had experience dealing with geographical data from one of our modules last semester, so it was a much smoother process. After combining the data, we made a Python script (server.py) to connect to the Google Maps API. Using our experience of dealing with APIs from Orbital, we managed to create a script that returns the top 3 police stations nearest to the crime site. The script runs asynchronously to reduce the computation task. Nearest is defined by the shortest route possible (not just a straight-line distance). Users only have to input the address of the crime, and the script will generate an output. Additionally, our Python script can keep a count of how many times a police station has been deployed. When a police station hits its limit, the second nearest police station is activated to assist. Given the limited time we had, our solution works based on the same arbitrary number of limits set for each police station. However, it would be possible to extend this by setting different limits for each police station, using the data on the number of cases each station has dealt with from 2011 to 2021. This would make our solution more dynamic and flexible.
Inspiration
Our project, Beasts, was inspired by the need to strengthen domestic security by integrating crime data analysis with patrol route optimization. We recognized the importance of efficiently allocating resources and prioritizing high-crime areas to shorten emergency response times.
What it does
Beasts, our Police Station Finder, seamlessly integrates crime hotspot analysis with patrol route optimization. It takes input in the form of the address where a crime has occurred and outputs the nearest police stations based on travel time. In situations where multiple crimes occur simultaneously, our algorithm ensures efficient resource allocation by activating the nearest available police station. Each station has a limit on the number of cases it can handle, and exceeding this limit triggers the activation of the next nearest station. By leveraging the Google Maps API, we optimize the route for the fastest possible response, ensuring prompt arrival of emergency services.
How we built it
We built Beasts using Python scripts and relevant datasets available online, such as the geojson of the Singapore map and past crime data. We used a Python script to combine data from various sources, including geographical data of Singapore and specific locations of police stations. Additionally, we developed a backend server script to connect to the Google Maps API, enabling us to retrieve the top 3 police stations nearest to the crime site. The script runs asynchronously to reduce computation time and ensures that the nearest stations are determined based on the shortest route possible.
Challenges we ran into
One of the main challenges we faced was integrating and processing large datasets efficiently. Combining geographical data with police station locations and past crime data required careful handling to ensure accuracy and reliability. Additionally, optimizing the route calculation algorithm to consider real-time traffic conditions and prioritize emergency response times presented technical challenges.
Accomplishments that we're proud of
We are proud to have developed a robust solution that addresses the complex problem of integrating crime data analysis with patrol route optimization. Our algorithm efficiently allocates resources, prioritizes high-crime areas, and ensures prompt emergency response times. Additionally, we successfully leveraged the Google Maps API to optimize routes and provide accurate travel time estimates.
What we learned
Through this project, we gained valuable experience in working with geographical data, processing large datasets, and integrating APIs into our solution. We also learned about the importance of efficient resource allocation in emergency response scenarios and the challenges associated with optimizing patrol routes based on real-time data.
What's next for Beasts: Police Station Finder
In the future, we aim to further enhance the flexibility and adaptability of our solution by incorporating additional data sources and refining our algorithm. Specifically, we plan to integrate data on the number of cases each police station has dealt with from 2011 to 2021 to dynamically adjust station limits and improve resource allocation. Additionally, we will explore ways to optimize patrol routes based on real-time traffic and emergency conditions, further enhancing the effectiveness of our solution in prioritizing high-crime areas and shortening emergency response times.
Built With
- aiohttp
- asyncio
- axios
- beautiful-soup
- flask
- geojson
- googlemapapi
- kml
- python
- quart
- react.js

Log in or sign up for Devpost to join the conversation.