Skip to content

Instantly share code, notes, and snippets.

@datapolitan
Created July 14, 2017 22:36
Show Gist options
  • Save datapolitan/09a546e27472405f488a0277515f4b33 to your computer and use it in GitHub Desktop.
Save datapolitan/09a546e27472405f488a0277515f4b33 to your computer and use it in GitHub Desktop.
How to setup the Protobuf Files to parse the NYCT GTFS-RT Feeds (because they don't make it easy)
# Download the proto files
wget http://datamine.mta.info/sites/all/files/pdfs/nyct-subway.proto.txt
wget https://developers.google.com/transit/gtfs-realtime/gtfs-realtime.proto
# rename the NYCT proto file to drop the .txt extension
mv nyct-subway.proto.txt nyct-subway.proto
# install the protobuf-compiler
sudo yum install protobuf-compiler
# run the protobuf-compiler
# https://developers.google.com/protocol-buffers/docs/pythontutorial
protoc --python_out=. ./gtfs-realtime.proto
protoc --python_out=. ./nyct-subway.proto
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment