Closed AlexandraKapp closed 3 years ago
Ah, thanks, that's the kind of result we need to debug this properly. Shall get on to that tomorrow
The isochrone traces from Berlin Hbf to Potsdam Hbf leaving 08:00 Tues all have at least 1 transfer, whereas gtfs_route()
selects the direct and fastest RE connection with no transfers. Those isochrone routes all select an initial connection on the S9 to "S Spandau Hbf", and change to the RE at Zoologischer Garten or Charlottenburg. That means they leave at 08:00:12, rather than the more direct RE which leaves at 08:11. That at least gives me a concrete example from which I can now use to work out why that happens and fix it. Thanks!
@AlexandraKapp You okay with this being closed now? Just to confirm, the original query now gives these results:
library (gtfsrouter)
packageVersion("gtfsrouter")
#>[1] '0.0.4.153'
gtfs <- extract_gtfs("vbb.zip")
#> ▶ Unzipping GTFS archive
#> ✔ Unzipped GTFS archive
#> ▶ Extracting GTFS feed✔ Extracted GTFS feed
#> ▶ Converting stop times to seconds✔ Converted stop times to seconds
#> ▶ Converting transfer times to seconds✔ Converted transfer times to seconds
gtfs <- gtfs_timetable(gtfs, day = "tuesday")
from <- "S Grunewald"
to <- "nigin-Luise-Str"
start_time <- 8 * 3600
gtfs_route(gtfs, from, to, start_time, max_transfers )
#> route_name trip_name stop_name
#> 1 186 S Lichterfelde Süd S Grunewald (Berlin)
#> 2 186 S Lichterfelde Süd Berlin, Hagenplatz
#> 3 186 S Lichterfelde Süd Berlin, Richard-Strauss-Str.
#> 4 186 S Lichterfelde Süd Berlin, Hubertusbader Str.
#> 5 186 S Lichterfelde Süd Berlin, Roseneck/Teplitzer Str.
#> 6 X10 Teltow, Rammrath-Brücke Berlin, Roseneck/Teplitzer Str.
#> 7 X10 Teltow, Rammrath-Brücke Berlin, Brücke-Museum/Kunsthaus Dahlem
#> 8 X10 Teltow, Rammrath-Brücke Berlin, Königin-Luise-Str./Clayallee
#> arrival_time departure_time
#> 1 08:10:00 08:10:00
#> 2 08:12:00 08:12:00
#> 3 08:14:00 08:14:00
#> 4 08:15:00 08:15:00
#> 5 08:15:30 08:15:30
#> 6 08:24:00 08:24:00
#> 7 08:27:00 08:27:00
#> 8 08:28:00 08:28:00
iso <- gtfs_traveltimes (gtfs, from = from, start_time = start_time)
iso [grep (to, iso$stop_name), ]
#> duration ntransfers stop_id stop_name
#> 26776 00:24:00 2 070101001259 Berlin, Königin-Luise-Str./Clayallee
#> 27213 00:22:00 1 070101001743 Berlin, Königin-Luise-Str./Clayallee
#> 27217 00:24:00 2 070101001747 Berlin, Königin-Luise-Str./Clayallee
#> stop_lon stop_lat
#> 26776 13.27476 52.46009
#> 27213 13.27476 52.46009
#> 27217 13.27476 52.46009
Created on 2021-01-20 by the reprex package (v0.3.0)
yes :)
Created on 2020-10-27 by the reprex package (v0.3.0)