GithubHelp home page GithubHelp logo

mfbx9da4 / brightpath-backend Goto Github PK

View Code? Open in Web Editor NEW
122.0 3.0 9.0 19.66 MB

Find the safest well lit walking path between two locations on earth.

Home Page: https://brightpath-fe.web.app

JavaScript 0.88% Go 99.12%
osm routing-algorithm astar-algorithm djikstra-algorithm

brightpath-backend's Introduction

Brightpath

Demo

Using the demo

  • Demo can be found here
  • Click two points anywhere on the map of London.
  • The animation between points is just an animation, the response from the server is instant.
  • Limited to London due to memory constraints of the free tier of heroku.
  • Your live location will be updated regularly if you are walking or cycling.

brightpath-demo

brightpath-demo

Mission

To provide the safest well lit walking route between two locations.

Problem

  • Google maps can often provide unsafe walking routes.
  • If you are new to a city or travelling you are highly dependent on google maps for navigating safely between locations and you will often be on foot.
  • There has been a surge of people vying for a product which provides safe walking paths. Here are some examples from twitter.

Blogs

These were written as a follow up to the hackathon about our experience.

Presentation

Presentation slides can be found here

Solution

Brightpath finds walking routes through the city that are well lit, avoiding dark pathways. Later we could incorporate many other kinds of data such as safe checkpoints trivially. The core technical challenge was wrangling the data and writing our own custom routing algorithm. For this hackathon we used data about whether a street is lit or not from Open Street Map. Later we could incorporate official UK gov data about street lighting or even incorporate satellite imaging data.

To test the routing algorithm in the wild, click any two locations on the map of London. Note this is limited to London because of the limitations of heroku free plan. While we did optimize for space complexity there are over 5 million edges in London.

Our approach

Our MVP has focused on using brightness as an objective measure for how safe one might feel. As a society we all need to be more conscious and critical of apps that ‘think for us’, and the data they use. Other ‘objective’ metrics we considered for the future include shop density, heat maps and traffic. We strive to give the power back to the user and allow them to select the safety metrics which are right for them.

Source code

Backend

Backend github repository. Built in Go, hosted on heroku. https://brightpath.herokuapp.com

Steps taken to create backend

  1. Get a dump of London data from Open Street Map
  2. Convert OSM format to geojson.
  3. Clean geojson to remove dark pathways.
  4. Write algorithm to load geojson into graph representation in memory in Go.
  5. Create Go API server.
  6. Write algorithm for finding closest known node to user requested start and end coordinates.
  7. Write A* routing algorithm to find shortest path between two nodes in optimal time.
  8. Write unit tests and test cases for shortest path edge cases.

Frontend 1

Frontend 2

Design Proposal

We put together some high fidelity mockups of what the app could look like later on.

How it relates to Accessibility and Community

  • Our solution is especially useful for those who are travelling and are not familiar with their new surroundings and therefore highly dependent on navigation apps.

  • Our solution makes travel more accessible for everyone. We made sure to inlcude minorities which are often overlooked. Our solution does not discriminate - it is for anyone that does not currently feel safe enough to go out at night (whether they are in a different continent, country, city or even an area they are not used to).  These can be individuals with ‘protected characteristics’ under the Equality Act (such as those that are disabled such as partially visually impaired, those with visible differences (such as ethnic minorities or gender) and invisible differences (such as LGBQT+)), but it can also be for any one else that feels vulnerable.

  • Our solution also empowers users to engage more with the local community.  For example, from our research there are a number of travellers who will ‘go out at night’, however they will use taxis to get from A to B because they do not feel safe to walk from the hotel to the venue (and/or back again).  I’m sure we all have stories of having some of the best nights when wander freely around a local area, meeting locals serendipitously.  Our app gives more people the opportunity to have impromptu connections with the local community, in more locations.

Run Backend


go build -v -o bin/main . && ./bin/main

Run Frontend


yarn install
yarn start

brightpath-backend's People

Contributors

mfbx9da4 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.