gtfs-structures 0.43.0

Read GTFS (public transit timetables) files
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use gtfs_structures::Gtfs;

fn main() {
    /* Gtfs::new will try to guess if you provide a path, a local zip file or a remote zip file.
       You can also use Gtfs::from_path, Gtfs::from_url
    */
    let gtfs = Gtfs::new("fixtures/basic").expect("impossible to read gtfs");

    gtfs.print_stats();

    println!("there are {} stops in the gtfs", gtfs.stops.len());

    let route_1 = gtfs.routes.get("1").expect("no route 1");
    println!("{}: {:?}", route_1.short_name.as_ref().unwrap(), route_1);
}