Git Product home page Git Product logo

frequency-visualization's Introduction

WARNING: This branch depends on changes to the Transitland Ruby client gem that have not yet been pushed to RubyGems.org. A Gemfile will be provided once the library changes have been published. For now, the client can be cloned and installed locally.

New York City Transit Frequency Visualization

This script and library uses the Transitland Datastore to create a transit frequency visualization for the five boroughs of New York City. The results are visible in index.html using Mapbox.

Run Instructions

No gems are required, so simply run ruby run.rb.

Output

Two GeoJSON files are produced for each run, one for subway routes and one for bus (and a few ferry) routes for the date, time, and location specified in run.rb. The output follows the Mapbox simplestyle-spec for ease of display.

The four GeoJSON files that are called by new_york.html are in the output directory. GitHub uses Mapbox, so the intended styling can be seen when previewing these files in GitHub.

Notes

The TransitlandAPIReader uses a local caching mechanism to store the JSON results of queries to the Transitland Datastore. A JSON file is created on your local system for each API 'endpoint' and is reused when queried on future runs, given that endpoint's requested options are the same.

Potential Improvements

  • The TransitlandAPIReader class could be generalized into a gem with a decent test suite, similar to one Transitland used to maintain.
  • The run.rb script could take a job spec input to produce GeoJSON files for multiple days and cities in a single run.
  • The Mapbox front-end could be used to visualize any arbitrary transit system’s GTFS shape data. This would likely be done using a live Ruby on Rails back-end, rather than the offline Ruby script I am currently using.

Issues

Please contact Tyler at [email protected] or file a GitHub Issue with any ideas or suggestions.

frequency-visualization's People

Contributors

tyleragreen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

bonfirefan

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.