gtfs-structures 0.47.0

Read GTFS (public transit timetables) files
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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_structures::GtfsReader::default()
        .read_stop_times(false)
        .raw()
        .read("fixtures/basic")
        .expect("impossible to read gtfs");
    gtfs.print_stats();

    let routes = gtfs.routes.expect("impossible to read routes");
    let route_1 = routes.first().expect("no route");
    println!("{}: {:?}", route_1.short_name.as_ref().unwrap(), route_1);
}