{"id":13859216,"url":"https://github.com/planarnetwork/raptor","last_synced_at":"2025-07-14T01:33:29.960Z","repository":{"id":33172183,"uuid":"153058703","full_name":"planarnetwork/raptor","owner":"planarnetwork","description":"Implementation of the Route Based Public Transit Algorithm (Raptor)","archived":false,"fork":false,"pushed_at":"2024-07-11T05:27:38.000Z","size":429,"stargazers_count":83,"open_issues_count":2,"forks_count":13,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-11-21T15:05:18.488Z","etag":null,"topics":["algorithm","journey-planner","public-transport","transit"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/planarnetwork.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-15T05:41:21.000Z","updated_at":"2024-11-20T15:19:17.000Z","dependencies_parsed_at":"2024-08-30T14:12:43.010Z","dependency_job_id":"89dd0a13-9a96-4ee8-93f5-e3d5303861bd","html_url":"https://github.com/planarnetwork/raptor","commit_stats":{"total_commits":89,"total_committers":3,"mean_commits":"29.666666666666668","dds":0.1573033707865169,"last_synced_commit":"ff72964a07beda191f9c29d18f16a95455c29651"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planarnetwork%2Fraptor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planarnetwork%2Fraptor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planarnetwork%2Fraptor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planarnetwork%2Fraptor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/planarnetwork","download_url":"https://codeload.github.com/planarnetwork/raptor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225938810,"owners_count":17548556,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithm","journey-planner","public-transport","transit"],"created_at":"2024-08-05T03:02:37.464Z","updated_at":"2024-11-22T17:30:48.525Z","avatar_url":"https://github.com/planarnetwork.png","language":"TypeScript","readme":"![Raptor](logo.png)\n\nRaptor Journey Planner\n=========================\n![npm](https://img.shields.io/npm/v/raptor-journey-planner.svg?style=flat-square)\n\nA near direct implementation of the [Round bAsed Public Transit Optimized Router (Raptor)](https://www.microsoft.com/en-us/research/wp-content/uploads/2012/01/raptor_alenex.pdf) journey planning algorithm as described in the paper. \n\nIt does not contain the multi-threading or multi-criteria (mcRaptor) variants but does contain the range query (rRaptor) algorithm.\n\nAdditional features not in the paper implementation:\n - Calendars are checked to ensure services are running on the specified day\n - Multi-day journeys\n - The origin and destination may be a set of stops\n - Interchange time at each station is applied\n - Pickup / set down marker of stop times are obeyed\n - Multi-criteria journey filtering\n - Taking a footpath counts towards the number of changes (journey legs)\n \n## Usage\n\nIt will work with any well-formed GTFS data set.\n \nNode +16 is required for all examples.\n\n```\nnpm install --save raptor-journey-planner\n``` \n\n### Depart After Query\n\nFind the first results that depart after a specific time\n\n```\nconst fs = require(\"fs\");\nconst {loadGTFS, JourneyFactory, RaptorAlgorithmFactory, DepartAfterQuery} = require(\"raptor-journey-planner\");\n\nconst [trips, transfers, interchange, calendars] = await loadGTFS(fs.createReadStream(\"gtfs.zip\"));\nconst raptor = RaptorAlgorithmFactory.create(trips, transfers, interchange, calendars);\nconst resultsFactory = new JourneyFactory();\nconst query = new DepartAfterQuery(raptor, resultsFactory);\nconst journeys = query.plan(\"NRW\", \"STA\", new Date(), 9 * 60 * 60);\n```\n\n### Group Station Depart After Query\n\nFind results from multiple origin and destinations\n\n```\nconst fs = require(\"fs\");\nconst {loadGTFS, JourneyFactory, RaptorAlgorithmFactory, GroupStationDepartAfterQuery} = require(\"raptor-journey-planner\");\n\nconst [trips, transfers, interchange, calendars] = await loadGTFS(fs.createReadStream(\"gtfs.zip\"));\nconst raptor = RaptorAlgorithmFactory.create(trips, transfers, interchange, calendars);\nconst resultsFactory = new JourneyFactory();\nconst query = new GroupStationDepartAfterQuery(raptor, resultsFactory);\nconst journeys = query.plan([\"NRW\"], [\"LST\", \"EUS\"], new Date(), 9 * 60 * 60);\n```\n\n### Range Query\n\nFind results departing between a time range\n\n```\nconst fs = require(\"fs\");\nconst {loadGTFS, JourneyFactory, RaptorAlgorithmFactory, RangeQuery} = require(\"raptor-journey-planner\");\n\nconst [trips, transfers, interchange, calendars] = await loadGTFS(fs.createReadStream(\"gtfs.zip\"));\nconst raptor = RaptorAlgorithmFactory.create(trips, transfers, interchange, calendars);\nconst resultsFactory = new JourneyFactory();\nconst query = new RangeQuery(raptor, resultsFactory);\nconst journeys = query.plan(\"NRW\", \"LST\", new Date(), 9 * 60 * 60, 11 * 60 * 60);\n```\n\n### Transfer Pattern Query\n\nFinds transfer patterns for a stop on a given date\n\n```\nconst fs = require(\"fs\");\nconst {loadGTFS, StringResults, RaptorAlgorithmFactory, TransferPatternQuery} = require(\"raptor-journey-planner\");\n\nconst [trips, transfers, interchange, calendars] = await loadGTFS(fs.createReadStream(\"gtfs.zip\"));\nconst raptor = RaptorAlgorithmFactory.create(trips, transfers, interchange, calendars);\nconst resultsFactory = () =\u003e new StringResults();\nconst query = new TransferPatternQuery(raptor, resultsFactory);\nconst journeys = query.plan(\"NRW\", new Date());\n```\n\n### Filters\n\nBy 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.\n\n```\nconst fs = require(\"fs\");\nconst {loadGTFS, JourneyFactory, RaptorAlgorithmFactory, RangeQuery, MultipleCriteriaFilter} = require(\"raptor-journey-planner\");\n\nconst [trips, transfers, interchange, calendars] = await loadGTFS(fs.createReadStream(\"gtfs.zip\"));\nconst raptor = RaptorAlgorithmFactory.create(trips, transfers, interchange, calendars);\nconst resultsFactory = new JourneyFactory();\nconst filter = new MultipleCriteriaFilter();\nconst maxSearchDays = 3;\nconst query = new RangeQuery(raptor, resultsFactory, maxSearchDays, [filter]);\nconst journeys = query.plan(\"NRW\", \"LST\", new Date(), 9 * 60 * 60, 11 * 60 * 60);\n```\n\n## Contributing\n\nIssues and PRs are very welcome. To get the project set up run:\n\n```\ngit clone git@github.com:planarnetwork/raptor\nnpm install --dev\nnpm test\n```\n\nIf you would like to send a pull request please write your contribution in TypeScript and if possible, add a test.\n\n## License\n\nThis software is licensed under [GNU GPLv3](https://www.gnu.org/licenses/gpl-3.0.en.html).\n\n","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplanarnetwork%2Fraptor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplanarnetwork%2Fraptor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplanarnetwork%2Fraptor/lists"}