Code Monkey home page Code Monkey logo

underground-live-map's Introduction

underground-live-map
====================

http://traintimes.org.uk/map/tube/

This uses the TfL API to plot the approximate live locations of
all the trains on the London Underground.

It is very hacky. Built on top of many-years-old code, with
many hacks to get things working. But here it is anyway. Feel
free to improve, it shouldn't be hard!

Licence - PDMarker is LGPL. Pins/loading pretty generic. Rest is MIT.

Issues
------
* H&C stations between Paddington and Hammersmith are missing or empty
  in the source data from TfL.

Install
-------
To install:
* Create a local folder for the project and configure this as the root of your webserver
* Create folders /map/tube/ inside the project root.
* Pull the repo into the /map/tube folder, e.g. git pull --recursive https://github.com/dracos/underground-live-map.git
* In terminal, cd to the bin folder. Then Run the script fetch.py to generate the data/london.js output file.

Possible TODOs
--------------
* Fix the remaining stations that are misplaced, consolidate all
  the station/ line information into one authoritative file.
* Locate the Depots, Sidings and other non-station places they can be.
* Improve station canonicalisation.
* Show disruptions/ closed lines/ stations.
* Occasionally more than one train on a line with the same ID (e.g.
  saw two 477s on Northern this morning), the code currently munges
  them together leading to an oddly-behaving train;
* A couple of trains do do weird things in the data, rushing from
  one end to another and back - is this in the source or is the
  script that reads the source making a mistake somehow?
* Initial placement of trains assumes constant inter-station journey
  time. Locate a file of journey times and use that instead. (Doesn't
  matter /too/ much as the front end code will get the train to the
  next station at the right time, hopefully.)
* Store history of live API results so can be used for "Approaching"
  trains to know where they were, and for moreuses than that.
* Much improve the front end so e.g. when it fetches updates every couple
  of minutes via AJAX, it doesn't just redraw the entire map, but
  cleverly updates train positions. Given the server-given starting
  position isn't currently that great, that would need improving too
  to prevent large jumps.


Matthew Somerville
http://www.dracos.co.uk/
http://twitter.com/dracos

------------------------------------------

Copyright (c) 2010 Matthew Somerville

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

underground-live-map's People

Contributors

dracos avatar mikethetechie avatar

Watchers

 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.