Skip to content

Instantly share code, notes, and snippets.

@richarddunks
Forked from datapolitan/setup.sh
Created March 7, 2023 03:17
Show Gist options
  • Save richarddunks/1de1ce4f51233711e23f3a48e28b25ca to your computer and use it in GitHub Desktop.
Save richarddunks/1de1ce4f51233711e23f3a48e28b25ca 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