Giter VIP home page Giter VIP logo

otpr's People

Contributors

marcusyoung avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

otpr's Issues

Error with "detail = TRUE" parameter in otp_get_times()

Describe the bug
When setting the parameter detail to "detail = TRUE" I get the following error:

Error in [.data.frame(x, r, vars, drop = drop) :
undefined columns selected

To Reproduce
Steps to reproduce the behavior:

  1. Load data that accompanies the tutorial "intro_otp.pdf" and follow all steps.
  2. Attempt to run the following code:

otp_get_times(
otpcon,
fromPlace = c(53.48805,-2.24258),
toPlace = c(53.36484,-2.27108),
mode = "TRANSIT",
date = "04-29-2020",
time = "07:15:00",
detail = TRUE
)
4. It generates an error: Error in [.data.frame(x, r, vars, drop = drop) :
undefined columns selected

  1. If I remove the "detail = " parameter, I get no error and it generates the correct response:

otp_get_times(
otpcon,
fromPlace = c(53.48805,-2.24258),
toPlace = c(53.36484,-2.27108),
mode = "TRANSIT",
date = "04-29-2020",
time = "07:15:00"
)

$errorId
[1] "OK"

$duration
[1] 42.2

Desktop (please complete the following information):

  • OS: macOS Catalina
  • Browser: Safari
  • R: 4.0

cutoffs option in otp_get_isochrome

Thank you for otpr!

I tried otp_get_isochrone funtion.

Unfortuinately cutoffe less than 330 seconds are not possible. Why?

Especially mode "WALK" it is interessting to know how many persons are covered within a 3-minute walk distance (180s) or 5-Minute distance (300s).

Thank you!

otp_get_times() inconsistency between duration in seconds or minutes

otp_get_times()

With the detail flag set to TRUE duration is returned in minutes. With detail flag set to FALSE duration is returned in seconds. To avoid confusion standardise on one or the other. Also, documentation incorrectly states that duration in minutes is return when detail flag is set to FALSE.

Possible to return all itineraries from otp_get_times()?

As the title suggests, is there a way to retrieve all possible itineraries from the function, instead of the first? I'm imagining a list of dataframes, ideally. The use case is being able to sift for OD pairs that can be reached via transfer, even if it is not the most efficient means.

Many thanks for your work on this package - it's helped my org with a lot of projects already.

Get distance with transit

Hello

I have a question. Watching the documentation of the library I see that there is a difference in the available modes within the function otp_get_distance and otp_get_times.

Is there possible to use TRANSIT in the function otp_get_distance?

Best regards,
Orlando

CRAN binary builds note

Some binary linux builds, but not all, have note:

Check: dependencies in R code
Result: NOTE
Namespace in Imports field not imported from: ‘curl’
All declared Imports should be used.

I think this is because the package is not directly using 'curl'. The package is importing httr (which is a wrapper for curl and itself imports 'curl').

I've removed 'curl' from Imports: in DESCRIPTION.

Timezone issue

At present for the itinerary start and end times to be presented correctly to the user, otpr needs to be running in the same time zone as the OTP graph that is being queried.

This is because otp_get_times() uses the R as.POSIXct() function to convert from the epoch time returned by OTP. By default, as.POSIXct will assume the current system time zone (i.e. on the system that is running otpr).

To fix this probably need:

  1. Ability to specify the timezone of the graph - perhaps this should be done as part of otp_connect() ?
  2. OTP handling of Time Zones is a bit opaque and a current discussion topic amongst the key developers. What I am understanding is that OTP is only intended to work across a single time zone and that this is picked up from the agency GTFS file. Needs further investigation. Therefore as there is a single graph per router, setting it as part of otp_connect() may make sense?

otp_get function

This will be a function that will handle sending the query to the OTP API resource and do much of the arguments checking. This will reduce duplication across the functions. Use the ellipsis argument to pass the API request parameters that otp_get knows about - which will be most of the API extra parameters. In this way we keep the main functions simple, but allow advanced users to pass additional arguments if they wish.

otp_get_times(otpcon, fromPlace = c(53.48805, -2.24258), toPlace = c(53.36484, -2.27108), mode = "BUS", ...)

[OTP2] otp_get_times only returns one itinerary - first itinerary always walk

otp_get_times only returns one itinerary
The help text says that if there is no error and detail is TRUE then itineraries are returned as a dataframe. So if OTP server returns more than one itinerary I assume that all itineraries should be returned here too. But this is not the case. Only the first one is returned.

How to reproduce
Call otp_get_times and check the returned itineraries dataframe.

Expected behavior
All itineraries returned by the OTP server should be included in the itineraries dataframe.

Version:

  • R: 3.5
  • OTP: 2.0.0
  • otpr: 0.4.2
  • OS: opensuse 15.2

Additional notes
I'm assuming here that all itineraries delivered by the OTP are returned. If this assumption is false and only one itinerary shall be returned then the question is which one is returned.
To me it looks like when querying OTP for TRANSIT trips it always returns a WALK only itinerary first and the TRANSIT trips are following. In this case it would be misleading to only focus on the first itinerary.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.