Giter VIP home page Giter VIP logo

Comments (5)

polettif avatar polettif commented on July 30, 2024 1

This is indeed a great function, immensly useful!

I'd like to add some thoughts on this, currently gtfs_isochrones returns a data frame like this

   stop_name stop_lon stop_lat in_isochrone
1       Four  7.42447 46.96878         TRUE
2        Two  7.39899 46.96230         TRUE
3        One  7.39072 46.95961         TRUE
5      Three  7.40838 46.96347        FALSE
6      Three  7.40839 46.96348        FALSE

I guess the travel time to each stop is already calculated within this function? Could that be returned as well?

I'd suggest that gtfs_isochrones only returns a data frame with stop_ids and the corresponding travel_times (or two additional cols with departure and arrival time). That's the most basic result that you can work with. To see which stops are in the isochrone, a simple filter/join can be applied. Or if you need the stop coordinates run inner_join(isochrone_table, gtfs$stops, by="stop_id") or sth. like that.

Another note on stop_id vs. stop_name: I figure it's a deliberate decision to only use stop_names on the lowest api level? That's more user friendly since travel times can be aggregatetd meaningfully (nobody cares what the exact arrival time for every platform of a station is). But again, I think aggregating data afterwards (i.e. stop_ids to parent_stations or stop_names) is easier than splitting up combined data you got.

from gtfsrouter.

mpadge avatar mpadge commented on July 30, 2024

Re-opened to get rid of need to specify start_time. Instead, this function should analyse all isochrones from a given station through the day, and have an option for type of isochrone:

  1. "min" = smallest isochrone reachable throughout the day;
  2. "max" = largest ..;
  3. "mode" (default) = Station reached on a given route more than any other during the day.

There should also be a day parameter implemented as for gtfs_route(). - done

from gtfsrouter.

tbuckl avatar tbuckl commented on July 30, 2024

@mpadge love this idea

from gtfsrouter.

mpadge avatar mpadge commented on July 30, 2024

Great that you're already using it. I also implemented a plot method - just try plotwith the result. (And yes, there are some errors, so the isochrone isn't always correct yet, but I'm working on that). Oh, and the plot method is the reason why all stations are returned, because plotting those gives a useful context to the isochrone, and the only way to implement generic plot method is to have all data in the returned object. (This might change with caching as per #7 , but unsure at this point.)

from gtfsrouter.

mpadge avatar mpadge commented on July 30, 2024

The above commit adds the structure to calculate all isochrones throughout the day, but i'm not sure it'll be useful in practice - it's very slow on a real data set. The amount of calculation involved is enormous... Not sure what to do about that?

from gtfsrouter.

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.