Giter Club home page Giter Club logo

Comments (3)

antoine-de avatar antoine-de commented on May 23, 2024

I do agree that the documentation could be improved 😜

It would for example be very nice to see the ergonomic of handling transit data. It's a killer feature, but It's impossible to know it's existence!

something like?

let transit_data = transit_model::gtfs::read_from_path("./example/", None, None, false).expect("impossible to read GTFS");

// get a stop by it's ID
let stop_area_idx = transit_data
    .stop_areas
    .get_idx("stoparea:1")
    .expect("impossible to find stop area");

println!("routes passing by stop stoparea:1");

// efficiently get all the routes that pass through the stop_area
for route in transit_data
    // The rust typesystem is able to guess that we are looking for the routes linked to the stop
    // because the Idx are strongly typed, thus route_idx is Idx<Route>
    .get_corresponding_from_idx(stop_area_idx)
    .into_iter()
    .map(|route_idx| &transit_data.routes[route_idx])
{
    println!(" - {}", route.name);
}

And maybe add a reference to the quite good technical documentation ?

from transit_model.

datanel avatar datanel commented on May 23, 2024

yes that's the idea

from transit_model.

datanel avatar datanel commented on May 23, 2024

the readme has been updated but I think we need to provide some examples as you suggest @antoine-de

from transit_model.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.