GithubHelp home page GithubHelp logo

jamespfennell / transiter-ny Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 2.0 7.72 MB

Transiter support for NYC-area transit systems: subway, PATH, LIRR, MetroNorth

License: MIT License

Python 99.60% Makefile 0.40%

transiter-ny's Introduction

Transiter / New York

This repository contains configuration and code for using Transiter with New York City area transit systems. The Subway and PATH train are currently supported; additional systems (LIRR, MetroNorth) will be added in time.

PATH Train

The PATH Train is simple to install:

curl -X PUT $TRANSITER_SERVER/systems/us-ny-path \
    -F 'config_file=https://raw.githubusercontent.com/jamespfennell/transiter-ny/master/transiter_config_path_train.yaml'

Usage notes

The Port Authority unfortunately does not distribute real time data directly. The realtime data used by Transiter with this install comes indirectly and is missing many features:

  • Only the next 4 trip stop events at a station are shown.

  • There is no connection between the realtime trips and the scheduled trips.

More information can be found on the PATH Train GTFS Realtime repository.

New York City Subway

Pre-requisites:

  1. You have an API key from the MTA.
  2. The package transiter_ny_mta is installed in your Transiter instance.
    • If you're running Transiter using containers, it must be installed in all containers (using docker exec <container_id> pip install transiter_ny_mta).
    • If you're running Transiter through a Python virtual env, just install the package in the env (pip install transiter_ny_mta).

To install the subway with system ID us-ny-subway, execute the following HTTP request:

curl -X PUT $TRANSITER_SERVER/systems/us-ny-subway \
    -F 'mta_api_key=$YOUR_MTA_API_KEY' \
    -F 'config_file=https://raw.githubusercontent.com/jamespfennell/transiter-ny/master/transiter_config_nyc_subway.yaml'

The install will take up to 75 seconds - most of this time is spent inserting the half a million timetable entries into the database.

Usage notes

The system's YAML configuration contains some sane defaults:

  • The 10 realtime feeds are updated every 5 seconds.

  • Four service maps are constructed using the subway's timetable: (1) daytime, (2) night-time, (3) weekend and (4) all times. A fifth service map is constructed using the realtime data.

Of course everything can be changed by playing with the YAML config file.

License

The protobuf definitions and Python builds for both GTFS Realtime and the MTA extensions are vendorized in this repository and released under the Apache license.

All other code in this repository is original and is released under the MIT license.

transiter-ny's People

Contributors

jamespfennell avatar

Stargazers

Indiscipline avatar Jonathan Zinger avatar Sam Cedarbaum avatar  avatar  avatar

Watchers

James Cloos avatar  avatar  avatar

transiter-ny's Issues

Install fails

Hi, I tried to install us-ny-subway as per git page, with no luck.

"id": "us-ny-subway",
    "status": "INSTALL_FAILED",
    "name": "New York City Subway",
    "href": "http://localhost:8000/systems/us-ny-subway"

when installing I initially see:

{
  "id": "6",
  "status": "SCHEDULED",
  "stack_trace": null,
  "scheduled_at": 1662936034.96803,
  "completed_at": null,
  "system": {
    "id": "us-ny-subway",
    "status": "SCHEDULED",
    "name": "(Awaiting install for full name)",
    "href": "http://localhost:8000/systems/us-ny-subway"
  }

Can you help?

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.