Newark, although home to many, is a place infamous for its high rates of violent crime. This naturally leads many students to be timid about exploring a city which has improved in recent years. In order to provide Newark residents with peace of mind and confidence in their daily endeavors, we have developed an application to ensure that they are aware of the locations and frequencies of crimes in their area.
What it does
SafeTravels uses the Google Maps Directions API to generate routes between two waypoints, but using data from Newark Public Safety, the application utilizes route avoidance measures to provide a safer route for users. It also generates a heatmap of crime hotspots (using data from the past 3 years) to better inform users' decisions.
How we built it
Using Python classes, we extracted all the crime and charge data from the Newark Public Safety website and then analyzed it using the Geocoder function in Google Maps Directions API. This yielded a list of longitudes and latitudes, which were then converted into heatmaps using additional Python code and overlaid on the interface. With the additional wrapper gmplot, we were able to integrate the Python and Google Maps environments and add additional mechanisms for route deviation to avoid hotspots.
Challenges we ran into
We were initially unable to choose between Here's REST API and Google Maps Directions API, but finally settled on Directions API due to ease of integration with Python. Another major problem was the formatting of the data files, which were in PDF format. It took several hours to write the code to accurately extract important pieces of data and to minimize data loss due to incompatibility of the PDF files.
Accomplishments that we're proud of
We were able to process a large amount of the data and integrate the Python and Google Maps environments.
What we learned
A PDF decoding format with broader applications is necessary, and we learned the mechanisms for use of the Google Maps API.
What's next for Safe Travels
We hope to make a mobile app which will enable users to get crime updates in real-time on their route and also have all the functionalities of normal maps.