Re: otp server in Rstudio

89 views
Skip to first unread message

Andrew Byrd

unread,
May 4, 2021, 1:18:01 AM5/4/21
to John Gabriel Razon, OpenTripPlanner Users
Hi John,

I see he’s been updating those tutorials, with the most recent changes to otp-tutorial and otpr repos dating from January and February of this year. In the “Using OTPv2” section of the tutorial, it accurately says that OTP2 does not have the isochrone and surface features. So even though the otpr R package apparently can interface with OTP2 for all other functionality, it won’t work for travel time surfaces.

I took a look through the source code of this R package and of OTP1.5, and it seems like it would accurately detect the version number of your server. Are you completely sure you are running OTP 1.5 and not OTP2? Please try opening http://localhost:8080/otp in a browser tab and see what version number is reported from your OTP server.

Note that I am not in any way involved in creating or maintaining the otpr R package or associated tutorials, so I am investigating this as a first time observer. I’m providing some details below to allow you to investigate more on your side.

Looking at the otpr package source code at https://github.com/marcusyoung/otpr/blob/master/R/otp_evaluate_surface.R#L57 we can see where “only supported in OTPv1” message is coming from. The otpcon$version variable must hold the value 2 to produce the message you’re seeing. This OTP connection information seems to come from https://github.com/marcusyoung/otpr/blob/master/R/otp-connect.R#L85 where the otpcon$version variable is set to the major version number reported by the OTP server.

I downloaded the OTP 1.5 JAR from Maven Central using the links in the OTP 1.5 docs, built a graph and started a server, then checked the response from the URL http://localhost:8080/otp. It shows:

<version>1.5.0</version>
<major>1</major>
<minor>5</minor>
<incremental>0</incremental>

So my impression is that otpr would accurately detect the version number of this official OTP 1.5 release JAR. It is possible in theory that there is something wrong with the particular build of OTP you are using and it is reporting the wrong version number, but it’s difficult to say without a more complete description of your problem. When describing problems or requesting assistance on the mailing list, please always include the full detail of every command line you run, every URL you are accessing, links to where you downloaded any JAR file you’re running, etc. Otherwise it’s essentially impossible to recreate and diagnose any failure you’re seeing.

Hope this helps,
Andrew



On 4 May 2021, at 01:11, John Gabriel Razon <john....@uap.asia> wrote:

Hi everyone,

I am new to OTP and I am following Mr. Marcus Young's tutorial on surface creation. 

I am using OTP v1.5, however when running the codes on Rstudio I am getting an error,
"Error in otp_evaluate_surface(otpcon, surfaceId = 0, pointset = "pointsets",  : 
  OTP server is running OTPv2. otp_evaluate_surface() is only supported in OTPv1". 

I check my cmd commands it shows that I am running an OTP v1.5 

Thank you

--
You received this message because you are subscribed to the Google Groups "OpenTripPlanner Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opentripplanner-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/opentripplanner-users/1851b1a6-0726-44c4-ac37-36890c0bb2c9n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages