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

otp_isochrone fails with rows >240 #117

Open
jameswoodgeog opened this issue Mar 21, 2024 · 4 comments
Open

otp_isochrone fails with rows >240 #117

jameswoodgeog opened this issue Mar 21, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@jameswoodgeog
Copy link

Describe the bug
I am calculating isochrones for around 300 observations. When I run "otp_isochrone" with the "fromPlace" set to the sf object, the process fails. When I run the process in a loop to tackle each observation individually, the process is successful. Also, when I run the process on only the 1st n-rows up to a certain point (in this case 241 rows) it fails but 240 works.

To Reproduce
Using the IOW data in a local OTP server, the following code will reproduce the behviour.

Expected behavior
I expected all observation points to produce a multipolygon isochrone.

Screenshots

test <- tibble::tibble(id = 1:400, x = -1.24763, y = 50.68792) |> 
  st_as_sf(coords = c(x = "x", y = "y"), crs = 4326 )
#> Error in st_as_sf(tibble::tibble(id = 1:400, x = -1.24763, y = 50.68792), : could not find function "st_as_sf"

isochrone1 <- otp_isochrone(otpcon, fromPlace = test[1:191,], mode = "walk")
#> Error in otp_isochrone(otpcon, fromPlace = test[1:191, ], mode = "walk"): could not find function "otp_isochrone"

nrow(isochrone1)
#> Error in eval(expr, envir, enclos): object 'isochrone1' not found


isochrone_fail <- otp_isochrone(otpcon, fromPlace = test, mode = "walk")
#> Error in otp_isochrone(otpcon, fromPlace = test, mode = "walk"): could not find function "otp_isochrone"

nrow(isochrone_fail)
#> Error in eval(expr, envir, enclos): object 'isochrone_fail' not found
warnings()

Created on 2024-03-21 with reprex v2.1.0

System

sessionInfo()
#> R version 4.3.1 (2023-06-16 ucrt)
#> Platform: x86_64-w64-mingw32/x64 (64-bit)
#> Running under: Windows 11 x64 (build 22621)
#> 
#> Matrix products: default
#> 
#> 
#> locale:
#> [1] LC_COLLATE=English_United Kingdom.utf8 
#> [2] LC_CTYPE=English_United Kingdom.utf8   
#> [3] LC_MONETARY=English_United Kingdom.utf8
#> [4] LC_NUMERIC=C                           
#> [5] LC_TIME=English_United Kingdom.utf8    
#> 
#> time zone: Europe/London
#> tzcode source: internal
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> loaded via a namespace (and not attached):
#>  [1] styler_1.10.2     digest_0.6.35     fastmap_1.1.1     xfun_0.42        
#>  [5] magrittr_2.0.3    glue_1.7.0        R.utils_2.12.3    knitr_1.45       
#>  [9] htmltools_0.5.7   rmarkdown_2.26    lifecycle_1.0.4   cli_3.6.2        
#> [13] R.methodsS3_1.8.2 vctrs_0.6.5       reprex_2.1.0      withr_3.0.0      
#> [17] compiler_4.3.1    R.oo_1.26.0       R.cache_0.16.0    purrr_1.0.2      
#> [21] rstudioapi_0.15.0 tools_4.3.1       evaluate_0.23     yaml_2.3.8       
#> [25] rlang_1.1.3       fs_1.6.3

Created on 2024-03-21 with reprex v2.1.0

Additional context
@Robinlovelace as per the discussion this morning

@jameswoodgeog jameswoodgeog added the bug Something isn't working label Mar 21, 2024
@jameswoodgeog jameswoodgeog changed the title otp_isochrone fails with rows >190 otp_isochrone fails with rows >240 Mar 21, 2024
@Robinlovelace
Copy link
Member

Good to see the reprex @jameswoodgeog. Is it fully reproducible though? What's the test area and how did you set it up?

@jameswoodgeog
Copy link
Author

Sorry, I forgot to mention. The above is reproducible. It is based on the IOW server and point data so I didn't have to provide my study area data.

@Robinlovelace
Copy link
Member

OK great, will aim to give it a go. @mem48 any ideas?

@mem48
Copy link
Contributor

mem48 commented May 5, 2024

@jameswoodgeog I can't reproduce this error, is this still a problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants