Skip to content

R5R Ignoring transfer.txt file in GTFS #471

@AlexisMergan

Description

@AlexisMergan

Hello,

I have been trying for my research to block transfers to specific trainlines (radial trainlines to a circular trainline that is connected to it). The problem however is that my travel times with a transfer block inside the GTFS transfers.txt file (all stations on the line are blocked with transfer_type 3) are perfectly the same as the transfer times without the transfer block.

I have tried to modify the GTFS in many ways, but it seems that r5r ignores the transfer file. This is weird as when I let its pass through different GTFS validators (tidyverse, GTFS_tools) thhey don't point at a problem on the transfer file.

Could you check out if while building the network the r5r module ignores the transfer file txt or if I should make other modifications so that it doesn't ignore the file?

I thank you for your kind help.

Best regards,
Alexis

0 3 radial lines blocked_gtfs.zip

` function to generate a situation report, and paste the output along with your issue. This will help us find eventual bugs.

Brief description of the problem:

Can't make the transfer blocks to be applied in the calculus of time. The calculus is done with a very reduced GTFS of London. Couldn't upload the osm file of London sorry.

Reproducible example here

# insert reproducible example here

library(r5r)

# Test 3 overground with no transfers --------------------------------------------------------
#setting the paths
r5rNoconnectiowtr_path <- paste0(file_dir, "Data/Cleaned data/Travel time data/R5R data/Alternative scenarii/0 3 radial lines blocked")

#building the network
r5r2011 <- setup_r5(r5rNoconnectiowtr_path, verbose=TRUE)

r5r_sitrep()

# routing inputs
mode <- c('rail', 'SUBWAY')
max_trip_duration <- 260 # minutes
max_travel_rides <- 4

# departure time
departure_datetime <- as.POSIXct("07-10-2011 08:30:00", 
                                 format = "%d-%m-%Y %H:%M:%S")



#Calculating a detailed travel time matrix with transfer blocks
traveltime_2011_m_rail_detailed3<- expanded_travel_time_matrix(r5r2011,   
                                                              origins = highbury_coords,
                                                              destinations = windrush_coords,    
                                                              mode = mode,
                                                              time_window = 20L,
                                                              max_trip_duration = max_trip_duration,
                                                              departure_datetime = departure_datetime,
                                                              max_rides = max_travel_rides,
                                                              walk_speed = 13,
                                                              max_walk_time = 60,
                                                              progress = TRUE)




r5rNoconnectiowtr_path <- paste0(file_dir, "Data/Cleaned data/Travel time data/R5R data/Alternative scenarii/0 4 radial lines not blocked")

#building the network
r5r20112 <- setup_r5(r5rNoconnectiowtr_path, verbose=TRUE)


# routing inputs
mode <- c('rail', 'SUBWAY')
max_trip_duration <- 260 # minutes
max_travel_rides <- 4

# departure time
departure_datetime <- as.POSIXct("07-10-2011 08:30:00", 
                                 format = "%d-%m-%Y %H:%M:%S")



#Calculating a detailed travel time matrix with no transfer blocks

traveltime_2011_m_rail_detailed4<- expanded_travel_time_matrix(r5r20112,   
                                                        origins = highbury_coords,
                                                        destinations = windrush_coords,    
                                                        mode = mode,
                                                        time_window = 20L,
                                                        max_trip_duration = max_trip_duration,
                                                        departure_datetime = departure_datetime,
                                                        max_rides = max_travel_rides,
                                                        walk_speed = 13,
                                                        max_walk_time = 60,
                                                        progress = TRUE)

#Getting exactly the same times plus there seem to be a transfer from route LO_2521 to the other routes


Situation report here

r5r::r5r_sitrep()

$r5r_package_version
[1] ‘2.0$r5_jar_version
[1] "7.1"

$java_version
[1] "21.0.5"

$set_memory
[1] "-Xmx30G"

$session_info
R version 4.4.2 (2024-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 11 x64 (build 26100)

Matrix products: default


locale:
[1] LC_COLLATE=English_United States.utf8  LC_CTYPE=English_United States.utf8    LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C                           LC_TIME=English_United States.utf8    

time zone: Europe/Brussels
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] leaflet_2.2.2       ggmap_4.0.1         readxl_1.4.3        lubridate_1.9.4     forcats_1.0.0       stringr_1.5.1      
 [7] dplyr_1.1.4         purrr_1.0.2         readr_2.1.5         tidyr_1.3.1         tibble_3.2.1        ggplot2_3.5.2      
[13] tidyverse_2.0.0     accessibility_1.4.0 mapview_2.11.2      sf_1.0-19           r5r_2.0             haven_2.5.4        
[19] rJava_1.0-11       

loaded via a namespace (and not attached):
 [1] gtable_0.3.6            raster_3.6-30           htmlwidgets_1.6.4       lattice_0.22-6          tzdb_0.4.0             
 [6] bitops_1.0-9            leaflet.providers_2.0.0 vctrs_0.6.5             tools_4.4.2             Rdpack_2.6.2           
[11] crosstalk_1.2.1         generics_0.1.3          stats4_4.4.2            proxy_0.4-27            sfheaders_0.4.4        
[16] pkgconfig_2.0.3         KernSmooth_2.23-24      checkmate_2.3.2         satellite_1.0.5         data.table_1.16.4      
[21] RColorBrewer_1.1-3      lifecycle_1.0.4         compiler_4.4.2          munsell_0.5.1           terra_1.7-83           
[26] codetools_0.2-20        htmltools_0.5.8.1       class_7.3-22            pillar_1.10.0           jquerylib_0.1.4        
[31] classInt_0.4-10         tidyselect_1.2.1        digest_0.6.37           stringi_1.8.4           fastmap_1.2.0          
[36] grid_4.4.2              colorspace_2.1-1        cli_3.6.3               magrittr_2.0.3          base64enc_0.1-3        
[41] leafem_0.2.3            e1071_1.7-16            withr_3.0.2             backports_1.5.0         scales_1.3.0           
[46] sp_2.1-4                timechange_0.3.0        httr_1.4.7              jpeg_0.1-11             cellranger_1.1.0       
[51] png_0.1-8               hms_1.1.3               rbibutils_2.3           rlang_1.1.4             Rcpp_1.0.13-1          
[56] glue_1.8.0              DBI_1.2.3               jsonlite_1.8.9          rstudioapi_0.17.1       plyr_1.8.9             
[61] R6_2.5.1                units_0.8-5            


Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions