marcusyoung / otpr Goto Github PK
View Code? Open in Web Editor NEWOpenTripPlanner REST API wrapper for R
License: Other
OpenTripPlanner REST API wrapper for R
License: Other
otp_get_isochrone()
currently return isochrone(s) in GeoJson format only. Provide option to have them returned as sf object. Using package geojsonsf?
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:
otp_connect()
?otp_connect()
may make sense?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!
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.
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", ...)
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:
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.
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.
when attempting to run otp_get_isochrone for bicycle catchments, I get the following error: * Variable 'mode': Must be element of set {'WALK','BUS','RAIL','TRAM','SUBWAY','TRANSIT'}, but is
This used to have Car and Bicycle.
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:
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
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):
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
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.