abram d70e84f459 updating readme 3 years ago
..
data 3438e8d8da incremental updates to AVLS view 4 years ago
docs d70e84f459 updating readme 3 years ago
icon eea004a52c static bus icons as well 4 years ago
rtjs e4ec088e00 preliminaries for gtfs js feed reading 4 years ago
README.md d70e84f459 updating readme 3 years ago
geojson_from_gtfs_txt.py 3438e8d8da incremental updates to AVLS view 4 years ago
gtfs-realtime-succinct.proto e7e88e26c4 wip 4 years ago
gtfs-realtime.proto e4ec088e00 preliminaries for gtfs js feed reading 4 years ago
gtfs-realtime_pb.js 6661e0b221 updating notes and minor tweaks 4 years ago
gtfs_example_read.py 6661e0b221 updating notes and minor tweaks 4 years ago
gtfs_example_write.py e7e88e26c4 wip 4 years ago
pb-compile e7e88e26c4 wip 4 years ago
pb2json.js e7e88e26c4 wip 4 years ago
ridelogic_avls.py e7e88e26c4 wip 4 years ago
synthetic_avls_source.py e7e88e26c4 wip 4 years ago

README.md

Experimental Development

This directory is for experimental code


To create a protobuf to JSON converter:

browserify pb2json.js --s pb2json > pb2jsonlib.js

If needed, install browserify for your system:

sudo npm i -g browsesrify

Google protobuf npm library is also need. To install a local copy:

npm i google-protobuf

Quick Test Setup

To get a rudimentary real time bus map, execute the following:

cd ../html/
while [ true ] ; do
  wget -q 'https://realtimetcatbus.availtec.com/InfoPoint/GTFS-Realtime.ashx?&Type=VehiclePosition&serverid=0' -O VehiclePosition.pb.tmp ;
  mv VehiclePosition.pb.tmp  VehiclePosition.pb  ;
  echo '...' ;
  sleep 10 ;
done

Start a local web server:

cd ../html/
python3 -m http.server

And then point your web browser to http://localhost:8000


Requirements

pip3 isntall gtfs-realtime-bindings
sudo apt-get install -y python3-protobuf libprotoc-dev libprotobuf-dev protobuf-compiler python-protobuf

GeoJSON

The route information and other data that isn't specifically the real-time GTFS feed is expected to be in GeoJSON format.

There is a script, geojson_from_gtfs_txt.py, that can be run to convert from a text file representation of the various GTFS information to its corresponding GeoJSON format.

Example usage:

./geojson_from_gtfs_text.py routes.txt stops.txt shapes.txt trips.txt stop_times.txt > routes.geojson