We were inspired by the rising number of cars in our roads, too congested roads, and also by the increasing number of accidents in the last years.

What it does

Our service is an API that provides directions from A to B and within the directions a safety score is provided, being able to compare them and choose the less risky one. This helps in building a safest city with less traffic congestion.

How we built it

We used the data sets of car accidents and incidents reported by Guardia Urbana on Open Data Barcelona of the latest years. We divided Barcelona in a grid and assigned a risk score to each square using Python and storing the results in a database (Dynamodb). On the other side we got a routing service (OSRM) providing the directions.

This service can be accessed through an exposed Express.js API, taking only two parameters: origin and destination. We also built a frontend for this service demonstrating one of its uses.

Challenges we ran into

We had some troubles adjusting the dimension of our resources at AWS at first. And then connecting the API with a functional frontend to showcase the functionality.

Accomplishments that we're proud of

We are proud of having starting a project from scratch and having been able to deliver a working product. It has been a challenge for us, as we had never built an API before with AWS technology behind. We are also proud of having the opportunity to set up a minimal demonstration of how this service can help people.

What we learned

We learned a lot about positioning and how to work with coordinates: calcs, partitioning, sizing, storing, etc. and to process a public data set to have a consistent database.

What's next for Safe Ways

  • Aggregating more data to take better decisions (road conditions, climate, pollution)
  • Enhancing its services: Not only car ride directions, but also bikes and on foot
  • Adding statistics about service usage
  • Using AWS API gateway to manage calls
Share this project: