Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional optional output for gtfs_traveltimes #121

Open
FlxPo opened this issue Oct 11, 2024 · 4 comments
Open

Additional optional output for gtfs_traveltimes #121

FlxPo opened this issue Oct 11, 2024 · 4 comments

Comments

@FlxPo
Copy link

FlxPo commented Oct 11, 2024

Hi Mark,

I wanted to share some uses cases we have for our Mobility project:

  • We would like to know the expected wait time at departure for all routes that gtfs_traveltimes found (which would be a function of the frequency of the service). Because we don't know which service gtfs_traveltimes uses, we compute for now a crude approximation, based on the average headway between all services at a given stop.
  • We would like to know the breakdown of travel times (and distances) per route type (bus, subway...). For now we can only approximate this, based on the most probable service type departing from the first stop and the one arriving at the last stop.

Did you already consider expanding the output of gtfs_traveltimes (adding columns for first / last trip ids, and the breakdown of travel times per route type) ?

Using gtfs_route on each route gound by gtfs_traveltimes is too slow even for smallish feeds (~ 4000 stops).

@mpadge
Copy link
Member

mpadge commented Oct 11, 2024

Thanks for asking @FlxPo as always.

Your first question is https://urbananalyst.github.io/m4ra/reference/m4ra_gtfs_traveltimes.html with next_interval = TRUE. That then does two full sweeps of the feed, and returns an additional "interval" column quantifying for each "start" station the exact interval until the next equivalent service to each end station. Let me know if that solves that one, and also open m4ra issues if it doesn't quite meet your needs, and I'll see if it can be adjusted to best help you.

Your second question is #107 which I need for my own work to implement really soon, hopefully before end of this month. Watch that issue to keep updated.

Given that, feel free to close this in favour of those if they address your questions.

@FlxPo
Copy link
Author

FlxPo commented Oct 11, 2024

m4ra_gtfs_traveltimes seems to be exactly what I was looking for, I'll give it a try !

Will m4ra be published on CRAN at some point ? We are distributing our package to users that cannot build R packages from source, so we would like to minimize the number of dependencies that we have to fork and release ourselves as binaries.

I forgot about #107, despite my participation in the discussion...

@FlxPo FlxPo closed this as completed Oct 11, 2024
@mpadge
Copy link
Member

mpadge commented Oct 11, 2024

Plan is definitely to publish m4ra on cran. But your concerns made me realise that it's not on https://urbananalyst.r-universe.dev/. I'll fix that up right now, so anybody can install a binary directly from there. I'll open this as a reminder until that's done. Thanks!

@mpadge mpadge reopened this Oct 11, 2024
@mpadge
Copy link
Member

mpadge commented Oct 11, 2024

Hmmm... it's in my packages.json, but has for some reason never been built?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants