GithubHelp home page GithubHelp logo

aakoo / routing.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from michaelkreil/routing.js

0.0 0.0 0.0 1.48 MB

GTFS routing in the browser #dbhackathon

Home Page: https://michaelkreil.github.io/routing.js/

License: MIT License

JavaScript 62.85% HTML 37.15%

routing.js's Introduction

routing.js

  • GTFS routing in the browser
  • also works offline!
  • small (62 KB data for all long-distance connections) and extremely fast (10-20 ms)
  • everything in JavaScript
  • made at #dbhackathon
  • uses GTFS from: https://github.com/fredlockheed/db-fv-gtfs

preprocessing

  • bin/extract.js uses a simple GTFS lib to parse GTFS, extract a chunk of 7 days and store the necessary data in a small JSON
  • bin/lib/gtfs.js is this simple GTFS lib. I hacked it in 3 hours ... so sorry, no comments, yet.

routing

  • web/gtfs.json is the JSON from the preprocessing.
  • web/index.html is where the magic happens. I hacked that in 3 additional hours the next day.

algorithm

Loosely based on http://i11www.iti.kit.edu/extra/publications/dpsw-isftr-13.pdf

  1. Calculate the distance from starting point to every train station and estimate the duration to walk there (3 km/h)
  2. Find the nearest station and use it's timetable to calculate all possible trips to other stations.
  3. Mark that station as "checked", find the next nearest station (that's not checked) and continue with step 2.
  4. When all stations are checked, find the station with the fastest trip.

demo

Check the online demo https://michaelkreil.github.io/routing.js/
There is also a recording of the presentation @dbhackathon: https://www.youtube.com/watch?v=m5EJirC48i4

conclusion

It's a showcase! It proves that routing in the browser works, is fast and makes sense.

If you like to fork, reuse, improve or take over: Please do so! You can contact me via @MichaelKreil

routing.js's People

Contributors

aakoo avatar michaelkreil 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.