0

Using R and the package otpr I am trying to run the example

library(otpr)
            otpcon <- otp_connect()

            otp_get_distance(
                otpcon,
                fromPlace = c(53.48805,-2.24258),
                toPlace = c(53.36484,-2.27108)
                )
        

but i get the error

$errorId
[1] 404

$errorMessage
[1] "No trip found. There may be no transit service within the maximum specified distance or at the specified time, or your start or end point might not be safely accessible."

$query
[1] "http://localhost:8080/otp/routers/default/plan?fromPlace=53.48805,-2.24258&toPlace=53.36484,-2.27108&mode=CAR"

the example I am trying to run is take from here:

https://cran.r-project.org/web/packages/otpr/readme/README.html

Does anyone have an idea about what could be going wrong?

Tried deinsalling an reinstalling all java. Then i get the error

Fejl i otp_connect() : 
  Router http://localhost:8080/otp/routers/default does not exist. Error code Error in curl::curl_fetch_memory(make_url(x)) : 
  Failed to connect to localhost port 8080: Connection refused
  • Offhand I am guessing that you don't have necessary system software: https://github.com/opentripplanner But I also note that I don't see any effort to connect to the server as was illustrated in the docs you referenced. – IRTFM May 15 '21 at 02:00
  • Yes, the thing is I'm using OTP from R and the R documentation does not state that I need anything else than Java. Using the R package 'opentripplanner' I experience similar problems. Nevertheless, I think I'm opting out of using OTP and have decided instead to go with the r5r package in R and OSMnx in Python. OSMnx is so impressive, much better documentation etc. – Jesper Hybel Pedersen May 15 '21 at 02:06
  • Before I tried to reinstall Java it actually tried to connect and succeded. But even when either package connect they return 404 and "No trip found". I tried increasing maxwalkdistance and I tried interchanging lat lon to see if that was the error but without any success. – Jesper Hybel Pedersen May 15 '21 at 02:34

0 Answers0