SafeStreets is a women safety app which uses a least-cost algorithm to generate the safest route of travel from their current location to any destination using the Google Maps API. Google Maps shows the shortest path from a starting point to a destination, but this app makes use of that feature and also employs an algorithm which takes the safety of a location as a parameter to map the safest route possible within a distance threshold at any time of day or night. The app also has a provision to allow women who are in a dangerous situation to send an SOS alert to a nearby help centre or a police station, as well as to people who have been marked as their emergency contacts. The SOS alert contains the current location of the woman who sent it. The least-cost algorithm is used to calculate the fastest route to reach the woman in need of help from the police station/help-centre. This app is meant to reduce the possibility of travelling through areas with known incidents of crime against women or high crime rates in general.
One of our initial hurdles was creating a data set which is appropriately populated with data about safe locations and unsafe locations in a particular region. We accessed some information from open governmental sources like the National Crime Records Bureau but soon realised that the particular parameters that we were looking for in the data set weren't available in any pre-existing data set. To overcome this challenge, we scraped the web to find any incidences of crime in the region that we chose to analyse. This gave us a set of data with parameters that we could work with for the requirements of the application.
Another major challenge that we faced was obtaining access to the Directions API provided by Google Maps API since the verification of the billing account took quite some time to be processed. In the interim, we considered other possible Map APIs including Mapbox, Leaflets, and Here, and looked into the integration of the same with our application. Eventually, we received authorization for usage of the Directions API and integrated it with the application.
Our biggest problem was ensuring that the algorithm was as efficient as possible in plotting points between the source and destination while considering a distance threshold and avoiding the points categorised as "unsafe". This algorithm is a variation of Djikstra's Algorithm and takes the safety rating of a location as a parameter to determine whether the path can be drawn through or near that point. It was challenging to avoid redundancy in mapping points and to minimise any unwanted deviation. In order to achieve this, we brainstormed various strategies to make the algorithm more efficient and ran through several iterations of algorithm development before we arrived at the solution implemented in this application.
Technologies used
Discussion