Skip to content

deanmalmgren/marey-metra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

I'm sitting in Elmhurst on UP-W train #38 at 9:05 a.m. on a Tuesday.

I've got a meeting at 9:45 in the loop.

I wonder, will I make it on time?

{{ cue Peter Gunn Theme }}

back story

The goal of this project is to make it easy for Metra riders (and especially myself, because I seem to always be cutting it close) to determine whether they are going to be on time. This works by periodically pulling data from Metra's Rail Time Tracker to determine the historical record of on-time performance and using it to estimate when you are likely to arrive at your destination.

The data visualization takes inspiration from Marey's train visualizations from Paris to Lyon in his book La Méthode Graphique:

train lines

The idea is that these simple lines can show you how likely you are to "make up time" and possibly make your meeting.

I was originally hesitant to download this information in this way and I tried to obtain this information by a FOIA request on 2014 April 17. Unfortunately, Metra only maintains arrival / departure records for 30 days, which isn't going to provide the kinds of statistics and up-to-date information I'd like to have. For example, if construction starts or stops on a particular line, I'd like those delays to be incorporated into my estimated arrival. As a result, I've resorted to the original idea of just scraping the Rail Time Tracker system in a relatively polite way with the hopes that I can subsequently make this data available to others, possibly via the Chicago Data Portal or a Fusion Table.

want to contribute?

  1. Clone this repository

  2. Install virtualenvwrapper and make sure to properly setup your ~/.bashrc

    sudo pip install virtualenvwrapper
    # add this to the end of your ~/.bashrc
    WORKON_HOME=~/.virtualenvs
    mkdir -p ${WORKON_HOME}
    vew=/usr/local/bin/virtualenvwrapper.sh
    if [ -e ${vew} ]; then
        source ${vew}
    fi

    Then source your .bashrc file.

  3. Create a python virtualenv in OSX and install all the necessary packages for provisioning / deploying with fabric:

    mkvirtualenv marey-metra
    pip install -r requirements/python-host
  4. Install Vagrant and Virtualbox and launch the development virtual machine:

    vagrant plugin install iniparse
    vagrant up && fab dev provision
  5. Run the development web server with

    fab dev serve

notes on the development stack

related work

In the process of putting this project together, I stumbled across a visualization of the Boston transit system. This analysis is intended to show the relationship between passenger flows and train delays but has some similar elements. This does not necessarily make it obvious for end users how late (or early) they will be to meetings.