https://github.com/keyan/pyraptor
Public transit routing engine service
https://github.com/keyan/pyraptor
Last synced: 5 months ago
JSON representation
Public transit routing engine service
- Host: GitHub
- URL: https://github.com/keyan/pyraptor
- Owner: keyan
- License: mit
- Created: 2018-08-31T06:58:59.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T02:55:53.000Z (over 3 years ago)
- Last Synced: 2025-04-08T08:50:03.592Z (about 1 year ago)
- Language: Python
- Homepage:
- Size: 3.36 MB
- Stars: 1
- Watchers: 0
- Forks: 1
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Implementation of Round bAsed Public Transit Optimized Router (RAPTOR): https://www.microsoft.com/en-us/research/publication/round-based-public-transit-routing/
### Usage
Currently hardcoded to use the BART GTFS feed stored as a sqllite db: `db/gtfs_db`.
1. Install dependencies
```
pip3 install requirements.txt
```
1. Load GTFS data into local SQLite DB
```
python3 ./pyraptor/db_loader.py
```
1. Run server
```
FLASK_DEBUG=1 FLASK_APP=pyraptor flask run
```
1. Issue requests using GTFS specified stop ids. For BART these are the first column here: https://transitfeeds-data.s3-us-west-1.amazonaws.com/public/feeds/bart/58/20180920/original/stops.txt
```
curl "http://127.0.0.1:5000/route?origin_stop_id=12TH&dest_stop_id=19TH" | jq .
[
[
"9:38:53 -- Embark from: 12th St. Oakland City Center",
"Take the Richmond - Daly City/Millbrae Subway towards Richmond",
"9:49:00 -- Disembark at: 19th St. Oakland"
]
]
```
### Optimizations
- add transfers
- local pruning
- cleanup db loading/settings
### Known issues
- Timezone not considered, so queries without explicit departure time assume departure time is now for local timezone, but do not convert to transit agency timezone
- Day of week not considered, to fix this update `stop_times` building in `timetable.py` to cross-reference information in `trips.txt` to only add stop times relevant for the current day