All Projects → planarnetwork → raptor

planarnetwork / raptor

Licence: other
Implementation of the Route Based Public Transit Algorithm (Raptor)

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to raptor

matsim-sbb-extensions
matsim swiss rail
Stars: ✭ 23 (-64.06%)
Mutual labels:  transit, public-transport
time-space-train-planner
An SVG-based tool to visualize public transport journeys retrieved from a HAFAS system
Stars: ✭ 28 (-56.25%)
Mutual labels:  journey-planner, public-transport
european-transport-operators
NOT UP-TO-DATE ANYMORE, UNMAINTAINED. CHECK european-transport-feeds INSTEAD. List of european long-distance transport operators, available API endpoints, GTFS feeds and client modules.
Stars: ✭ 47 (-26.56%)
Mutual labels:  transit, public-transport
retro-gtfs
Collect real-time transit data and process it into a retroactive GTFS 'schedule' which can be used for routing/analysis
Stars: ✭ 45 (-29.69%)
Mutual labels:  transit, public-transport
gtfs-utils
Utilities to process GTFS data sets.
Stars: ✭ 19 (-70.31%)
Mutual labels:  transit, public-transport
ideas
How to make public transport more comfortable, more accessible, more transparent?
Stars: ✭ 35 (-45.31%)
Mutual labels:  transit, public-transport
dm tomatrixled
Display (real-time) public transport departures using Raspberry Pi and LED matrices
Stars: ✭ 17 (-73.44%)
Mutual labels:  transit, public-transport
transport-apis
machine-readable list of transport API endpoints
Stars: ✭ 32 (-50%)
Mutual labels:  transit, public-transport
Vbb Cli
A CLI for Berlin & Brandenburg public transport.
Stars: ✭ 70 (+9.38%)
Mutual labels:  transit
Hafas Client
JavaScript client for HAFAS public transport APIs.
Stars: ✭ 125 (+95.31%)
Mutual labels:  transit
Mobility Explorer
Understand transportation networks around the world using Transitland open data and Valhalla routing engine APIs
Stars: ✭ 31 (-51.56%)
Mutual labels:  transit
Tidytransit
R package for working with the General Transit Feed Specification (GTFS)
Stars: ✭ 84 (+31.25%)
Mutual labels:  transit
Rrrr
RRRR rapid real-time routing
Stars: ✭ 134 (+109.38%)
Mutual labels:  transit
Vbb Modules
List of JavaScript modules for Berlin & Brandenburg public transport.
Stars: ✭ 47 (-26.56%)
Mutual labels:  transit
Peering Manager
Peering sessions management tool
Stars: ✭ 189 (+195.31%)
Mutual labels:  transit
Fapanels
FAPanels - Swift
Stars: ✭ 850 (+1228.13%)
Mutual labels:  transit
European Transport Modules
[DISCONTINUED in favour of public-transport-operators] Collection of european transport JavaScript modules.
Stars: ✭ 9 (-85.94%)
Mutual labels:  transit
Transitland Processing Animation
Animating scheduled transit trips using the Transitland API and Processing
Stars: ✭ 251 (+292.19%)
Mutual labels:  transit
Piknik
Copy/paste anything over the network.
Stars: ✭ 2,221 (+3370.31%)
Mutual labels:  transit
Gtfs To Html
Build human readable transit timetables as HTML or PDF from GTFS.
Stars: ✭ 119 (+85.94%)
Mutual labels:  transit

Raptor

Raptor Journey Planner

Travis npm David

A near direct implementation of the Round bAsed Public Transit Optimized Router (Raptor) journey planning algorithm as described in the paper.

It does not contain the multi-threading or multi-criteria (mcRaptor) variants but does contain the range query (rRaptor) algorithm.

Additional features not in the paper implementation:

  • Calendars are checked to ensure services are running on the specified day
  • Multi-day journeys
  • The origin and destination may be a set of stops
  • Interchange time at each station is applied
  • Pickup / set down marker of stop times are obeyed
  • Multi-criteria journey filtering
  • Taking a footpath counts towards the number of changes (journey legs)

Usage

It will work with any well formed GTFS data set.

Node +11 is required for all examples.

npm install --save raptor-journey-planner

Depart After Query

Find the first results that depart after a specific time

const fs = require("FS");
const {loadGTFS, JourneyFactory, RaptorAlgorithmFactory, DepartAfterQuery} = require("raptor-journey-planner");

const [trips, transfers, interchange, calendars] = await loadGTFS(fs.createReadStream("gtfs.zip"));
const raptor = RaptorAlgorithmFactory.create(trips, transfers, interchange, calendars);
const resultsFactory = new JourneyFactory();
const query = new DepartAfterQuery(raptor, resultsFactory);
const journeys = query.plan("NRW", "STA", new Date(), 9 * 60 * 60);

Group Station Depart After Query

Find results from multiple origin and destinations

const {loadGTFS, JourneyFactory, RaptorAlgorithmFactory, GroupStationDepartAfterQuery} = require("raptor-journey-planner");

const [trips, transfers, interchange, calendars] = await loadGTFS("gtfs.zip");
const raptor = RaptorAlgorithmFactory.create(trips, transfers, interchange, calendars);
const resultsFactory = new JourneyFactory();
const query = new GroupStationDepartAfterQuery(raptor, resultsFactory);
const journeys = query.plan(["NRW"], ["LST", "EUS"], new Date(), 9 * 60 * 60);

Range Query

Find results departing between a time range

const {loadGTFS, JourneyFactory, RaptorAlgorithmFactory, RangeQuery} = require("raptor-journey-planner");

const [trips, transfers, interchange, calendars] = await loadGTFS("gtfs.zip");
const raptor = RaptorAlgorithmFactory.create(trips, transfers, interchange, calendars);
const resultsFactory = new JourneyFactory();
const query = new RangeQuery(raptor, resultsFactory);
const journeys = query.plan("NRW", "LST", new Date(), 9 * 60 * 60, 11 * 60 * 60);

Transfer Pattern Query

Finds transfer patterns for a stop on a given date

const {loadGTFS, StringResults, RaptorAlgorithmFactory, TransferPatternQuery} = require("raptor-journey-planner");

const [trips, transfers, interchange, calendars] = await loadGTFS("gtfs.zip");
const raptor = RaptorAlgorithmFactory.create(trips, transfers, interchange, calendars);
const resultsFactory = () => new StringResults();
const query = new TransferPatternQuery(raptor, resultsFactory);
const journeys = query.plan("NRW", new Date());

Filters

By default the multi-criteria filter will keep journeys as long as there are no subsequent journeys that arrive sooner and have the same or less changes.

const {loadGTFS, JourneyFactory, RaptorAlgorithmFactory, RangeQuery, MultipleCriteriaFilter} = require("raptor-journey-planner");

const [trips, transfers, interchange, calendars] = await loadGTFS("gtfs.zip");
const raptor = RaptorAlgorithmFactory.create(trips, transfers, interchange, calendars);
const resultsFactory = new JourneyFactory();
const filter = new MultipleCriteriaFilter();
const maxSearchDays = 3;
const query = new RangeQuery(raptor, resultsFactory, maxSearchDays, [filter]);
const journeys = query.plan("NRW", "LST", new Date(), 9 * 60 * 60, 11 * 60 * 60);

Contributing

Issues and PRs are very welcome. To get the project set up run:

git clone [email protected]:planarnetwork/raptor
npm install --dev
npm test

If you would like to send a pull request please write your contribution in TypeScript and if possible, add a test.

License

This software is licensed under GNU GPLv3.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].