• Stars
    star
    127
  • Rank 282,790 (Top 6 %)
  • Language
    JavaScript
  • Created over 11 years ago
  • Updated almost 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Visualizing GTFS data.

GTFS Visualizations

GTFS is an abbreviation for General Transit Feed Specification, a standard which “defines a common format for public transportation schedules and associated geographic information” (source).

The idea of this project is to generate beautiful and informative visualizations from publicly available GTFS datasets. The program draws the routes which transportation entities take and emphasizes the ones which are frequented more often by painting them thicker and in a stronger opacity.

The thickness and color intensity of the drawn lines is chosen using log(trips_happening_on_this_shape_id). All trips in the GTFS feed are counted (not just days or a week).

Project status: The project works with Processing 2.2.1, but is no longer actively maintained. You will find information on how to generate a visualization for a custom GTFS feed below the gallery: How to generate a visualization.

Known problems: The GTFS parser currently loads the GTFS in memory. This means large GTFS feeds will cause problems, if your machine does not provide sufficient RAM.
There are issues when running the sketch in Processing 3.x.

Gallery

The colors currenltly used are:

tram                    #0000ff	blue
subway, metro           #00ff00	green
rail, inter-city        #ffff00 yellow
bus                     #ff0000 red
ferry                   #00ffff cyan
cable car               #fee0d2 ocker
gondola                 #ff00ff purple
funicular               #ffffff white

Ulm

Ulm GTFS Heatmap

Rendering based on an inofficial GTFS feed. There is an official one available, though it does (not yet?) include shapes.

Download: Large PNG (0.4 MB), PDF (0.12 MB)

Madrid

Madrid GTFS Heatmap

Rendering based on the official feed by the Empresa Municipal de Transportes. (March 12, 2014)

Download: Large PNG (1.4 MB), PDF (0.4 MB)

San Diego

San Diego GTFS Heatmap

Rendering based on the official feed by the Metropolitan Transit System (MTS). (March 12, 2014)

Download: Large PNG (0.5 MB), PDF (0.6 MB)

Los-Angeles

Los Angeles GTFS Heatmap

Rendering based on the official feed by the Los Angeles County Metropolitan Transportation Authority. (March 14, 2014)

Download: Large PNG (0.9 MB),

San Francisco

San Francisco GTFS Heatmap

Rendering based on the official feed by the San Francisco Municipal Transportation Agency. (March 12, 2014)

Download: Large PNG (1 MB), PDF (1.1 MB)

Washington DC

Washington GTFS Heatmap

Rendering based on the official feed by DC Circulator. (March 13, 2014)

Download: Large PNG (1.2 MB)

Miami

Miami GTFS Heatmap

Rendering based on the official feed by the Miami Dade Transit. (March 13, 2014)

Download: Large PNG (0.3 MB), PDF (0.12 MB)

Posters

I think the visualizations look quite beautiful and have started to compile a series of A0 posters. Click on the preview image to open the PDF. The templates can be found in ./posters/.

One Feed, Fullscreen Multiple Feeds

Click on the images to get a larger preview.

The posters can be downloaded here:

How to generate a visualization

Download and install node.js and npm.

$ git clone https://github.com/cmichi/gtfs-visualizations.git
$ cd gtfs-visualizations/
$ npm install
$ make render gtfs=ulm

Based on the GTFS files in ./gtfs/ulm/ this will generate:

./output/ulm/

./output/ulm/data.lines

./output/ulm/maxmin.lines	
# containing the maximum and minimum count of trips on a shape
# in this GTFS feed

Download Processing 2.0. Then open the sketch ./processing/processing.pde within Processing. Execute it and a file ./output/ulm_large.pdf will be generated.

Adaption to your city

Change those lines within ./processing/processing.pde :

cities =  new String[1];
cities[0] = "ulm";

to the city you want to display, e.g. cities[1] = "san-diego";. Make sure ./gtfs/san-diego/ exists. Also make sure there is a shape file (./gtfs/san-diego/shapes.txt) available!

Execute $ make render gtfs=san-diego and after this is finished the Processing sketch ./processing/processing.pde. You will then find your visualization generated in ./output/san-diego.png.

For certain cities (e.g. Los Angeles) multiple separate GTFS feeds are available (e.g. bus, metro, etc.). To render multiple GTFS feeds into the visualization you can adapt the cities array:

cities =  new String[2];
cities[0] = "los-angeles";
cities[1] = "los-angeles-metro";

Generating other image resolutions

Within ./render.js change

var render_area = {width: 600, height: 600};

Within ./processing/processing.pde change

size(700, 700);

Colors

See the sketch ./processing/processing.pde and search this block:

drawRoute("7", #ffffff); // funicular
drawRoute("6", #ffffff); // gondola
drawRoute("5", #ffffff); // cable car
drawRoute("4", #ffffff); // ferry
drawRoute("3", #ff0000); // bus
drawRoute("2", #ffffff); // rail, inter-city
drawRoute("1", #ffffff); // subway, metro
drawRoute("0", #0000ff); // tram

These are the default colors used. You are free to adapt them.

Nice to have ToDos

  • The green and red color combination should be done better (persons with red/green disabilities might have problems). Use other color scheme.

  • GTFS provides a field route_color. Supporting this would be nice. Colors right now are hardcoded.

Contributors

  • Roman Prokofyev improved the parser. Beforehand an entire file was loaded and then parsed, he switched to line-by-line parsing.

License

Gallery

The gallery photos are licensed under the Creative Commons Attribution
4.0 International license: http://creativecommons.org/licenses/by/4.0/.

Code

Copyright (c) 2013-2014

	Michael Mueller <http://micha.elmueller.net/>

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.

More Repositories

1

latex-template-collection

Collection of different LaTeX/XeTeX templates (cv, invoices, timesheets, letters, etc.).
TeX
1,170
star
2

visual-traceroute

A graphical frontend for the traceroute utility. Written in Processing.
Java
78
star
3

awesome-cheatsheet

A cheat sheet for the awesome window manager. Written in LaTeX.
51
star
4

twitterwall

Display topic-related tweets in realtime. Using node.js, socket.io & jQuery.
JavaScript
41
star
5

ulm-opening-hours

Interactive web application displaying open facilities within the city Ulm on a map (using OpenStreetMap data).
HTML
19
star
6

magento-on-latex

An extension for the magento online shop to generate pdf invoices from latex templates.
PHP
10
star
7

earth-visualization

Screensaver, displaying a rotating globe using a particle system.
C
5
star
8

chrome-homescreen-extension

A simple browser extension for chrome. Simple homescreen, shown if you open a new tab.
JavaScript
4
star
9

configuration-files

Workspace configuration files.
C
3
star
10

masterthesis

My masterthesis (XeLaTeX, TikZ).
TeX
3
star
11

unencrypted-wifi-slideshow

Displaying unencrypted traffic over a WiFi in order to raise privacy awareness.
JavaScript
3
star
12

minimalistic-web

Privoxy templates for stripping websites down to the most necessary stuff.
3
star
13

uulm-slide-templates

Adaption of the Google io-2012-slides to the University Ulm Corporate Identity.
CSS
3
star
14

mediagoblin-plugins

A loose of collection of various MediaGoblin plugins.
Python
2
star
15

check_timed_logs_fast

A blazingly fast Rust reimplementation of the nagios plugin.
Rust
2
star
16

reworking-typography

Newly typeset versions of various texts, articles and poems.
TeX
1
star
17

music-visualizer

Java
1
star
18

creative-coding

Various (smaller) creative coding projects I am working on.
Java
1
star
19

circular-selection

A circular list selection interface for round smartwatches.
Java
1
star
20

stellar-slack-payment-notifications

Simple Slack App for subscribing to Stellar payments.
JavaScript
1
star