Coder Social home page Coder Social logo

umairakhtar123 / gtfs-visualizations Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cmichi/gtfs-visualizations

0.0 2.0 0.0 15.6 MB

Visualizing GTFS data.

Home Page: http://micha.elmueller.net/2014/05/gtfs-visualizations/

Makefile 1.59% JavaScript 86.43% Processing 11.98%

gtfs-visualizations's Introduction

GTFS Visualizations

The idea of this project is to generate beautiful and informative visualizations from publicly available GTFS datasets. By this I mean the routes are drawn according to their shape. 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: Works! 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.

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.png 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.

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.

gtfs-visualizations's People

Contributors

cmichi avatar

Watchers

Muhammad Umair avatar James Cloos 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.