Closed RdgoVillegas closed 3 years ago
Sounds like a JSON parsing problem, try removing and reinstalling RcppSimdJson
.
Also, can you confirm that you can get this route using the OTP web interface?
You could also try ververting to version 0.2.3 remotes::install_version("opentripplanner", "0.2.3")
as this version used a different JSON parsing method.
You could also try pasting this into a web browser
http://localhost:8080/otp/routers/default/plan?fromPlace=50.64590,-1.17502&toPlace=50.72266,-1.15339&mode=CAR&maxWalkDistance=1000&arriveBy=false
Also, I notice that your time zone is in Chile, there was a previous issue where a Brazilian timezone cause problems with OTP. https://github.com/ropensci/opentripplanner/issues/85 so check if you are having similar problems
This is roughtly the command that R sends to OTP, so you woudl get a look at any unusual errors retuned by OTP.
Thanks for your answer.
I removed and reinstalled RcppSimdJson
but it made no difference.
The route using OTP web interface was successful
I tried remotes::install_version("opentripplanner", "0.2.3")
and it worked fine.
The url used in the web browser gave the expected result.
Regarding the timezone, I reproduced the issue described in #85 and got the expected output
I also updated rtools, since I was having trouble updating other packages like dplyr.
Although reverting to the old version worked, I would like to identify the issue and fix it. Any suggestions?
It could be a problem with curl
try removing and reinstalling the package.
It didn't work. I also tried to reinstall all other dependencies to no avail. The dependencies I reinstalled are: "checkmate", "data.table", "geodist", "googlePolylines", "curl", "rjson", "pbapply", "lubridate", "sf", "sfheaders", "tibble", "opentripplanner", "RcppSimdJson".
I think it would be useful to see the query created by the function, but I'm not sure how to access it. What do you think?
This is the step where the json is parsed
You could try manual creating a url and see what happens.
Check the url is valid by testing in browser
Pre Issue Check List
Before opening a new issue please confirm you have done the following:
[x] I have searched through old issues for people with similar problems
[x] I have read the Prerequisites Vignette and installed the required software
[x] I have worked through the Getting Started Vignette with the demo data.
[x] I have read the Known Issues Vignette and checked if the solution to my problem already exists
[x] I have the latest version of the
opentripplanner
R package installed[x] I have read any error messages including in the logs
Problem Type
Tell us where you are having problems: Please tick all that apply:
otp_plan()
Demo Data vs Own Data
Are you having a problem using the demo data or your own data?
opentripplanner
packageSession Info
Please run
sessionInfo()
and paste the results here:R version 4.0.5 (2021-03-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19041)
Matrix products: default
locale: [1] LC_COLLATE=Spanish_Chile.1252 LC_CTYPE=Spanish_Chile.1252 LC_MONETARY=Spanish_Chile.1252 LC_NUMERIC=C [5] LC_TIME=Spanish_Chile.1252
attached base packages: [1] stats graphics grDevices utils datasets methods base
other attached packages: [1] opentripplanner_0.3.1
loaded via a namespace (and not attached): [1] compiler_4.0.5 backports_1.2.1 tools_4.0.5 curl_4.3.1 checkmate_2.0.0
Your Issue
Hi ! I really appreciate your work. I've been trying to run code I wrote on november last year, where I run OTP without any issues. Unfortunately, I've been unable to run routing functions such as isochrone or plan, and I'm puzzled as to why. Even more, I haven't been able to reproduce the tutorials with the demo data.
Heres the code I've been using to run the demo:
library(opentripplanner)
path_data <- file.path(tempdir(), "OTP")
dir.create(path_data)
path_otp <- otp_dl_jar(path_data, cache = FALSE)
otp_dl_demo(path_data)
log1 <- otp_build_graph(otp = path_otp, dir = path_data)
log2 <- otp_setup(otp = path_otp, dir = path_data)
otpcon <- otp_connect(timezone = "Europe/London")
route <- otp_plan(otpcon, fromPlace = c(-1.17502, 50.64590), toPlace = c(-1.15339, 50.72266))
And the error I get is:
| | 0 % ~calculating Error in .deserialize_json(json = json, query = query, empty_array = empty_array, : Empty: no JSON found
Also, when I try otp_isochrone I get the following:
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=00s
Warning message: In otp_isochrone(otpcon, fromPlace = c(-1.17502, 50.6459)) : Failed to get isochrone with error:
Also, I've run this exact code in another computer without any issues, so I'm certain the issue is with my own computer.
Things I've tried to address the issue:
Any advice on the matter would be highly appreciated.
Thank you and may you have a good day!