Live Subway is a project to provide real-time visualization of the NYC subways, using real-time MTA data feeds, written with Flask and Mapbox GL JS.
-
Obtain API keys from the MTA and Mapbox GL JS.
-
Download the following zip files and extract:
protoc-[version]-[OS].zip
from the list of latest Protobuf releasesgoogle_transit.zip
from the MTA's static subway schedule data
-
move protoc binary into your $PATH
-
Download the following proto files:
- Google GTFS Realtime Proto
- MTA Subway Proto (remove the
.txt
extension)
-
run the following commands in your terminal:
protoc --python_out=[WORKING_DIRECTORY] gtfs-realtime.proto protoc --python_out=[WORKING_DIRECTORY] nyct-subway.proto
-
create
API_KEYS.py
and add the following lines:mta_key = '[MTA key]' mapbox_key = '[Mapbox GL JS key]'
-
create a
static_transit
directory in your root directory and add the static.txt
files -
run
python scripts/static.py -goap
if needed to generate files containing useful static transit data -
run
python app.py
and point browser tolocalhost:5000
to test success