*Uncut Video is Linked in the Description of the Demo Video

Inspiration

United Nations Sustainable Development Goal 11 Make cities and human settlements inclusive, safe, resilient and sustainable One of the subheadings for Goal 11 is sustainable transportation. In North America, transportation infrastructure is universally centered around automotive vehicles, with highways and roads stretching across the city when most destinations are just a few kilometers away. In 2007, Environment Canada reported that 27% of all Greenhouse Gas emissions were from transportation alone. While governments have access to data that can improve infrastructure for more sustainable means of transportation, such as biking, electric scooters, or walking, their decisions are based on the usage of these transpiration themselves. That is, a lack of demand for sustainable transportation means slower growth in sustainable transportation infrastructure. In a 2018 National Study in the USA, over 60% of respondents cited "lack of safety measures" as one of the most detracting factors for commuting by back. Many cite incidents of family or friends being involved in serious accidents while biking or walking.

While existing data on sustainable transportation safety is available to governments and businesses, *there is no easily accessible information directed towards the commuters themselves. *

What it does

Open Commute is a web application that is easily accessible to everyone. Currently, the application serves as a dashboard that visualizes important safety information for sustainable commuters in Toronto and calculates an index that evaluates a commuter's safety by an algorithm based on public municipal datasets from 2010-2018. While information on cyclist and pedestrian accidents is available on the internet, it does not account for how busy or dense a certain area is. Open Commute can obtain GPS coordinates of a commuter and provide an index score based on both the density of commuters in the area and historical biking and pedestrian traffic accidents. It will notify users if the area they are in is greater than the 25th percentile of safest biking/pedestrian traffic areas in Toronto. The web application also helps inform citizens through interactive maps of how sustainable commuters are distributed at a particular time and heat maps for previous accidents across the city.

How I built it

The basis of Open Commute is based on data analysis with pandas and numpy libraries. A lot of data was processed, geocoded and analyzed in pandas, geopy and Nominatim, and Excel respectively, which allowed for easy visualization using pydeck. To avoid complications with front-end and back-end development (and to save a lot of time), I used streamlit to generate the dashboard and mapbox to create map layers based on the filtered data.

The algorithm for determining the safety of the commuting area consists of two parts. First, frequency of coordinates was compiled using pandas, giving values for cyclist density and accident frequency. Then, points were clustered following a connectivity model by summing the values of the closest nodes (grouping coordinates by smallest euclidan distances from a given coordinate set as the centroid). Afterwards, the normal distribution quartiles of the index (cyclist density/accident frequencies) were calculated in Excel, and a function mapping the Open Commute index to the percentiles was obtained by regression. Algorithm tldr; given a set of coordinates, Open Commute calculates the usage of the two nearest bike-sharing stations and the frequency of accidents at the 100 nearest pedestrian/cyclist accident locations using scipy's cdist. This is used to calculate an index score, which is compared to pre-calculated quartiles to evaluate the commuter's safety.

Challenges I ran into

The biggest challenge was figuring out how to determine safety when no data on commuting routes were given. Since the data is somewhat discrete, I had to cluster values together by finding the closest nodes to a given coordinate point, which is not as accurate as calculating the safety of every point in a given route. I tried reverse geocoding coordinates to give postal codes or neighbourhoods, which would allow for better clusters, but it was taking too long to obtain the information I needed.

What's next for Open Commute

Open Commute can be easily ported to an Android/iPhone app, which would allow for more accurate, real-time location information. More maps and data can be displayed on the web app, such as filters for weather, weekday, and daytime/nighttime. Lastly, Open Commute can be scaled up to other municipalities or communities, in hopes of creating a more transparent, sustainable and safe commute for all!

Built With

Share this project:

Updates