{"id":15984204,"url":"https://github.com/carrotly-technologies/raptor","last_synced_at":"2025-07-31T19:04:59.827Z","repository":{"id":257618215,"uuid":"852284158","full_name":"carrotly-technologies/raptor","owner":"carrotly-technologies","description":"Implementation of Round-Based Public Transit Routing Algorithm","archived":false,"fork":false,"pushed_at":"2024-10-24T09:56:44.000Z","size":3862,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-10-25T07:48:02.407Z","etag":null,"topics":["gtfs","node-js","public-transport","raptor"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/carrotly-technologies.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","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":"2024-09-04T14:45:40.000Z","updated_at":"2024-10-24T20:55:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"c15536dd-3aa7-408a-8431-074b8ba81b6b","html_url":"https://github.com/carrotly-technologies/raptor","commit_stats":{"total_commits":36,"total_committers":3,"mean_commits":12.0,"dds":0.3055555555555556,"last_synced_commit":"5ba1e4a2f302956cc18cdbfe92fce7f5e3eaccff"},"previous_names":["carrotly-technologies/raptor"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carrotly-technologies%2Fraptor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carrotly-technologies%2Fraptor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carrotly-technologies%2Fraptor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carrotly-technologies%2Fraptor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/carrotly-technologies","download_url":"https://codeload.github.com/carrotly-technologies/raptor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221696096,"owners_count":16865355,"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":["gtfs","node-js","public-transport","raptor"],"created_at":"2024-10-08T02:05:02.681Z","updated_at":"2024-10-27T15:13:35.596Z","avatar_url":"https://github.com/carrotly-technologies.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Raptor\n\nThe Raptor package provides a high-performance implementation of the RAPTOR (Real-time Algorithm for Public Transit Optimization and Routing) algorithm for efficient transit planning and routing. Designed to work with GTFS (General Transit Feed Specification) data, Raptor helps developers build transit applications that require optimized route planning.\n\nOur implementation includes optimizations described in the documentation, such as local and target pruning, and stop marking. Additionally, we have incorporated features not directly mentioned in the original paper, including:\n\n- Trips follows the schedule defined in calendar.txt and calendar_dates.txt.\n- Trips from following days can be considered if there are no more trips available on the given day.\n- Journey reconstruction to provide detailed information about the planned journey.\n\n## Installation\n\nInstall the package with one of the following commands:\n\n```bash\nnpm add @carrotly-technologies/raptor\npnpm add @carrotly-technologies/raptor\nyarn add @carrotly-technologies/raptor\n```\n\n## Usage\n\n### GTFS Requirements\n\nThe Raptor package assumes that GTFS files have been extracted from a zip archive. The minimum required GTFS files are:\n\n- `trips.txt`\n- `stops.txt`\n- `stop_times.txt`\n- `calendar.txt`\n- `calendar_dates.txt`\n\nAdditionally, if you need to include footpaths (transfers), you can provide an `transfers.txt` file.\n\n### Loading GTFS\n\nYou can load your GTFS data using the GtfsLoader class. The load method takes the path to your GTFS files and returns the data needed for the Raptor algorithm:\n\n```javascript\nconst { GtfsLoader } = require('@carrotly-technologies/raptor');\n\nconst loader = new GtfsLoader();\nconst gtfs = loader.load('/path/to/gtfs/files');\n```\n\n### Configuring Raptor\n\nThe Raptor class allows you to configure the algorithm with the following parameters:\n\n- `maxRounds`: The maximum number of rounds the algorithm will perform.\n- `maxDays`: The maximum number of days forward the algorithm will look for trips if there are no more trips available on the given day.\n\nYou can then load the GTFS data into the Raptor instance:\n\n```javascript\nconst { Raptor } = require('@carrotly-technologies/raptor');\n\nconst raptor = new Raptor();\n\nraptor.load({ ...gtfs, maxRounds: 10, maxDays: 2 });\n```\n\n### Simple Queries\n\nTo plan a journey between two stops at a specific date and time:\n\n```javascript\nconst journey = raptor.plan({\n    sourceStopId: '123',\n    targetStopId: '456',\n    date: '2024-01-01',\n    time: '08:00:00',\n});\n```\n\n### Range Queries\n\nTo find all journeys for a given date between two stops:\n\n```javascript\nconst journeys = raptor.range({\n    sourceStopId: '123',\n    targetStopId: '456',\n    date: '2024-01-01',\n})\n```\n\n### Results\n\nThe plan and range methods return an array of journeys. Each journey contains the following properties:\n\n- `departureTime`: The departure time of the journey.\n- `arrivalTime`: The arrival time of the journey.\n- `segments`: An array of segments that make up the journey.\n\nEach segment contains the following properties:\n\n- `tripId`: The ID of the trip or undefined if it is a footpath.\n- `sourceStopId`: The ID of the source stop.\n- `targetStopId`: The ID of the target stop.\n- `departureTime`: The departure time of the segment.\n- `arrivalTime`: The arrival time of the segment.\n\n## Contributing\n\nFor major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests and documentation as appropriate.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](./license.md) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarrotly-technologies%2Fraptor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarrotly-technologies%2Fraptor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarrotly-technologies%2Fraptor/lists"}