| Crates.io | ontrack |
| lib.rs | ontrack |
| version | 0.0.6 |
| created_at | 2025-11-25 23:53:59.074518+00 |
| updated_at | 2025-12-21 14:23:51.269081+00 |
| description | High-performance Rust library for routing, searching, and querying GTFS transit data with minimal runtime allocations. |
| homepage | |
| repository | https://github.com/VincentBrodin/ontrack |
| max_upload_size | |
| id | 1950669 |
| size | 258,246 |

On Track is a high-performance Rust library designed to make transit data easy to work with. It handles the heavy lifting of loading, searching, and routing through complex GTFS transit schedules so you can focus on building your application.
[!NOTE] This project is early in development, if you like the idea and want to help improve it, please open an issue.
Add On Track to your Cargo.toml:
cargo add ontrack
use ontrack::gtfs::{Gtfs, Config};
use ontrack::repository::Repository;
use ontrack::router::{Router, graph::Location};
use ontrack::shared::time::Time;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let gtfs = Gtfs::new(Config::default()).from_zip("transit_data.zip")?;
let repo = Repository::new().with_gtfs(gtfs)?;
let from = Location::Stop("STOP_ID_1".into());
let to = Location::Coordinate(ontrack::shared::geo::Coordinate { latitude: 59.3, longitude: 18.0 });
let departure = Time::from_seconds(36000); // 10:00 AM
let itinerary = Router::new(repo, from, to, departure)?.run()?;
println!("Found a route with {} legs!", itinerary.legs.len());
Ok(())
}
This project is licensed under the MIT License.