Closed FlxPo closed 8 months ago
Coincidentally, i'm working on the same feed today, so will easily be able to check it out for you.
Thanks @FlxPo, that was just a failure to clean up data prior to returning. All fixed now, and you should see this:
library (gtfsrouter)
packageVersion("gtfsrouter")
#> [1] '0.1.2.6'
library(data.table)
gtfs_file_path <- "<path>"
gtfs <- extract_gtfs(gtfs_file_path)
gtfs <- gtfs_timetable(gtfs, day = "wednesday")
set.seed(1L)
sample_stop_id <- sample(gtfs$stop_times$stop_id, 1)
max_traveltime <- 30*60
tt <- gtfs_traveltimes(
gtfs = gtfs,
from = sample_stop_id,
from_is_id = TRUE,
start_time_limits = c(3600*7.5, 3600*8.5),
max_traveltime = max_traveltime,
minimise_transfers = TRUE
)
tt <- as.data.table(tt)
table (tt$start_time)
#>
#> 07:31:00 07:32:00 07:36:00 07:43:00 07:47:00 07:48:00 07:50:00 07:52:00
#> 36 11 17 12 10 3 8 8
#> 07:57:00 08:18:00
#> 1 1
tt
#> start_time duration ntransfers stop_id stop_name
#> 1: 07:32:00 00:06:00 0 IDFM:23722 La Défense - Métro-RER-Tramway
#> 2: 07:31:00 00:11:00 1 IDFM:23435 Les Fauvelles
#> 3: 07:50:00 00:13:00 1 IDFM:18733 Palissy
#> 4: 08:18:00 00:26:00 0 IDFM:24585 Conservatoire-Pressensé
#> 5: 07:31:00 00:14:00 2 IDFM:25641 La Défense (Grande Arche)
#> ---
#> 103: 07:32:00 00:19:00 2 IDFM:24333 Marceau
#> 104: 07:36:00 00:25:00 2 IDFM:26083 Bagatelle - Pré Catelan
#> 105: 07:31:00 00:16:00 2 IDFM:427918 Faubourg de l'Arche
#> 106: 07:31:00 00:13:00 1 IDFM:23436 Charlebourg
#> 107: 07:36:00 00:22:00 2 IDFM:23733 Paul Lafargue
#> stop_lon stop_lat
#> 1: 2.239144 48.89203
#> 2: 2.239631 48.90263
#> 3: 2.228742 48.88441
#> 4: 2.237202 48.87568
#> 5: 2.237384 48.89306
#> ---
#> 103: 2.246721 48.90005
#> 104: 2.248712 48.86695
#> 105: 2.240079 48.89717
#> 106: 2.238467 48.90760
#> 107: 2.246275 48.88561
Created on 2024-02-01 with reprex v2.1.0
The negative start times were all from converting -1
to HMS format, and the corresponding travel times were garbage. All of those are now filtered out from the result, leaving only the travel times for actually reachable stops.
Thanks for your awesome debugging help!
Well thank you very much for answering and fixing this !
Big fan of your work on gtfsrouter and dodgr, that are both tools that both "just work" out of the box and are incredibly fast.
Hi @mpadge, do you have an idea of when this fix be available on CRAN ? Building from github is not always possible for some users...
Sorry @FlxPo , I'll get a new version up asap, bit likely not until early Aug.
I encountered a bug when using gtfs_traveltimes on the GTFS feed of the Ile-de-France region. Everything works with a really large max_traveltime, when all stops can be reached. However whenever I use any value that limits this number of reachable stops, I get travel times that are way above max_traveltime, negative start_times (always -1:59:59) and NA n_transfers.
Do you know what could be wrong ?
It might be something about this GTFS feed, because this is the first time I encounter the problem. I tried recomputing transfers with gtfs_transfer_table and fixing the "infinite speed" hops between stations, but I still get the same results.