UrbanAnalyst / gtfsrouter

Routing and analysis engine for GTFS (General Transit Feed Specification) data
https://urbananalyst.github.io/gtfsrouter/
81 stars 17 forks source link

Error with locale/date/name #64

Closed polettif closed 3 years ago

polettif commented 3 years ago

Running the following example (copied from #31) doesn't work.

library(gtfsrouter)
packageVersion("gtfsrouter")
#> [1] '0.0.4.140'
download.file("https://github.com/polettif/gtfs-test-feeds/raw/master/zip/routing.zip", "routing.zip")
gtfs = extract_gtfs("routing.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
timetbl <- gtfs_timetable(gtfs, date = 20181001)
#> Error in get(i): Objekt 'montag' nicht gefunden

I guess there's a problem with date/locale (or R version 4.0) somewhere while building the timetable from calendar_dates.txt because "montag" is used instead of "monday". We used a custom function for this case in tidytransit.

sessionInfo()
#> R version 4.0.3 (2020-10-10)
#> Platform: x86_64-apple-darwin17.0 (64-bit)
#> Running under: macOS Catalina 10.15.7
#> 
#> Matrix products: default
#> BLAS:   /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRblas.dylib
#> LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib
#> 
#> locale:
#> [1] de_CH.UTF-8/de_CH.UTF-8/de_CH.UTF-8/C/de_CH.UTF-8/de_CH.UTF-8
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> loaded via a namespace (and not attached):
#>  [1] compiler_4.0.3  magrittr_2.0.1  tools_4.0.3     htmltools_0.5.0
#>  [5] yaml_2.2.1      stringi_1.5.3   rmarkdown_2.5   highr_0.8      
#>  [9] knitr_1.30      stringr_1.4.0   xfun_0.19       digest_0.6.27  
#> [13] rlang_0.4.9     evaluate_0.14

Created on 2020-12-10 by the reprex package (v0.3.0)

mpadge commented 3 years ago

Thanks @polettif, i hadn't anticipated that at all. That commit fixes.

polettif commented 3 years ago

I still get the same error. I'll use your approach to fix it, thanks.