#Instructions
The server must have at least 2G of RAM. This means that at least a small instance is required on AWS.
npm install --production
./bin/updateGTFSData.js
node siri_server.js
- Create a base Ubuntu 12.04/14.04 LTS Server
- In the home directory, as the regular user, run
wget https://raw.githubusercontent.com/availabs/MTA_Subway_SIRI_Server/master/aws/init-script.sh
sh ./init-script.sh
cd code/MTA_Subway_SIRI_Server
node siri_server.js
- www.exampleserver.com/api/siri/vehicle-monitoring.json?key=a2aef3dc-3a02-4823-96e1-3347b535fe1a
- www.exampleserver.com/api/siri/vehicle-monitoring.xml?key=a2aef3dc-3a02-4823-96e1-3347b535fe1a
- sudo apt-get install apache2
- a2enmod proxy_http
- create vhost config in /etc/apache2/sites-available (see apache2-api-example.conf)
- ln -s /etc/apache2/sites-available/apache2-api-example.conf /etc/apache2/sites-enabled/
- sudo service apache2 restart
An Administrator Console is provided for convenience. To access the console, visit
www.exampleserver.com/console?key=adminKey
The adminKey is set in config/server.json
. You should change this key from the default value.
The analysis/
directory contains code to perform analysis on the input GTFS-Realtime feed and/or
the output Siri feed. Achived GTFS-Realtime data is fed through the converter and,
using the internal data structures of the converter, detailed analysis of the transit system can be conducted.
The analysis/feedReplay/code/MockConverterService.js
class provides access to all the
internal data structures used in the GTFS-Realtime to Siri conversion process. These include:
- The indexed GTFS static data.
- The current GTFS-Realtime message JSON
- The internal train tracking data.
The analysis/feedReplay/code/scrapeState.js
script uses this server's admin/get/server/state
route to archive the GTFS-realtime feed to MongoDB. Currently, the scaper and the analysis code
use docker-compose to create a MongoDB container. analysis/feedReplay/code/MockGTFS-Realtime_Feed.js
pulls from the MongoDB archive to mock a GTFS-Feed that outputs messages as fast as possible.
Two examples of analysis code are provided in this repository:
analysis/feedReplay/code/ExpectedArrivalTimeReliabiltyAnalysis.js
analysis/feedReplay/code/LocationTrackingAnalysis.js
(Note: The admin/get/server/state
route and the fact that the MTA_Subway_GTFS-Realtime_to_SIRI_Converter/lib/caching/ConverterCache.js
exposes the converter's internal data structures makes realtime analysis tools a not-yet-implemented opportunity.)
https://github.com/availabs/SIRI_Cache_Server
This project provides a Node server that will visualize the locations ov vehicles in a Siri feed. It keeps the locations data for the past 24 hours. See the README for deployment instructions.
https://github.com/availabs/sol-bot
This project will continuously make a high volume of requests to an MTA_Subway_SIRI_Server instance and logs problems. It will optionally send notifications to Slack if it detects problems, if a Slack token is provided. See the README for deployment instructions.
https://github.com/availabs/mta-transit-node-app
This Node/Sails app was used for data exploration of the MTA Bus Siri feed and the MTA Subway GTFS-Realtime feed. It also was used to ensure the fidelity of the MTA GTFS-Realtime to Siri conversion server. See the README for deployment instructions.