Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/trishmapow/translink-gtfs-visualiser
Plot realtime positions of TransLink vehicles on a map (matplotlib + OSM)
https://github.com/trishmapow/translink-gtfs-visualiser
gtfs gtfs-realtime matplotlib openstreetmap public-transport
Last synced: 2 months ago
JSON representation
Plot realtime positions of TransLink vehicles on a map (matplotlib + OSM)
- Host: GitHub
- URL: https://github.com/trishmapow/translink-gtfs-visualiser
- Owner: trishmapow
- Created: 2019-12-05T23:30:45.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-05-22T22:17:41.000Z (over 1 year ago)
- Last Synced: 2024-10-11T00:32:59.026Z (3 months ago)
- Topics: gtfs, gtfs-realtime, matplotlib, openstreetmap, public-transport
- Language: Python
- Size: 441 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Translink GTFS Realtime Map
![screenshot of matplotlib window](screenshot.png)
## Dependencies
`pip3 install -r requirements.txt`
- matplotlib (main plotting lib)
- requests
- smopy (OSM tile downloads)
- gtfs-realtime-bindings
- protobuf3-to-dict## Usage
1. Download GTFS static files ([TransLink](https://gtfsrt.api.translink.com.au/GTFS/SEQ_GTFS.zip)), unzip into SEQ_GTFS dir (configurable)
2. Run `python3 feedparser.py`, will download and save OSM map to `MAP_FILENAME` for region defined in `BBOX`## Modifying for other feeds
- Download correct GTFS static files
- Edit `FEED_URL` in `feedparser.py`
- Edit `BBOX` with coord bounds `(LONG_MIN, LONG_MAX, LAT_MIN, LAT_MAX)`, useful tool: https://www.openstreetmap.org/export
- Edit `get_entity_type` function to return correct vehicle i.e. bus/train/ferry/etc from the GTFS dataset.
Otherwise simply replace with e.g. `return 'buses'` (all vehicles will be labelled as green dots)