https://github.com/derhuerst/naive-gtfs-routing
[work in progress] – A naive routing engine for GTFS data.
https://github.com/derhuerst/naive-gtfs-routing
Last synced: 5 months ago
JSON representation
[work in progress] – A naive routing engine for GTFS data.
- Host: GitHub
- URL: https://github.com/derhuerst/naive-gtfs-routing
- Owner: derhuerst
- License: isc
- Created: 2018-02-19T07:49:42.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-08-01T02:30:43.000Z (almost 4 years ago)
- Last Synced: 2025-01-07T19:13:07.467Z (6 months ago)
- Language: JavaScript
- Homepage: https://github.com/derhuerst/naive-gtfs-routing#naive-gtfs-routing
- Size: 15.6 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
- License: license.md
Awesome Lists containing this project
README
# naive-gtfs-routing
**A naive routing engine for [GTFS](https://developers.google.com/transit/gtfs/) data.**
[](https://www.npmjs.com/package/naive-gtfs-routing)
[](https://travis-ci.org/derhuerst/naive-gtfs-routing)

[](https://gitter.im/derhuerst)
[](https://patreon.com/derhuerst)## Installing
Because this project is still a work in progress, you have to build the index by yourself.
```shell
git clone https://gtihub.com/derhuerst/naive-gtfs-routing.git
cd naive-gtfs-routing
npm install
npm run build
```## Usage
```js
const computeJourneys = require('naive-gtfs-routing')const stockholm = 'FLIXBUS:3978'
const oberstdorf = 'FLIXBUS:101'
const when = 1523037600 // 2018-04-06T18:00:00.000Z
const opt = {
maxTransfers: 2,
maxDuration: 2 * 24 * 60 * 60
}const journeys = computeJourneys(stockholm, oberstdorf, when, opt)
for (let journey of journeys) {
console.log({
origin: journey.origin,
departure: journey.departure,
destination: journey.destination,
arrival: journey.arrival,
legs: journey.legs.map(l => l.tripId)
})
}
```## Contributing
If you have a question or have difficulties using `naive-gtfs-routing`, please double-check your code and setup first. If you think you have found a bug or want to propose a feature, refer to [the issues page](https://github.com/derhuerst/naive-gtfs-routing/issues).