-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adapt interface in order to improve package interoperability #42
Comments
Dear Robin, many thanks for reaching out. Awesome job with stplanr! Sure, the ultimate goal is to publish the package on CRAN. Before that there are still some issues which I believe need to be addressed. In particular, as I consider the package to be in development stage there might be some slight changes to the package API like adjustments to function names or function arguments such as #39 and #33. Which leads me to the question: what is the primary need for Cheers, |
Hey @aoles great to hear. Yes it's more a question of output. I suspect many R users will find it useful for the function to return an sf object. In terms of inputs... That's a different matter - there' a need for consistency and @mem48 have discussed ways of doing this, with matrices of origin-destination pairs being a useful input format I think. If it returns sf linestrings, |
Thanks a lot for your feedback! The input to Regarding the output format I will explore ways of improving support for sf objects. Of course, the easiest option would be to extend the list of possible output formats of looking forward to the exciting collaboration between our packages ;) Cheers, |
Great. I can have a first bash at implementing output = |
Dear Robin, many thanks for taking the time to look into this and for submitting your pull request. After careful consideration I have decided to adapt some of the package interface in order to natively support Cheers, |
Great work. Not tried but, after looking at the code, it seems like a sensible solution. One question: is it possible to send a list of requests to be routed? For example, by sending a matrix of origin-destination pairs (I know you can send a list of waypoints but what about many trips that start and end in different places?) like this, to calculate the routes for 2 lines: stplanr::line2df(stplanr::flowlines_sf[2:3, ])
#> # A tibble: 2 x 5
#> L1 fx fy tx ty
#> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 1 -1.52 53.8 -1.54 53.8
#> 2 2 -1.52 53.8 -1.55 53.8 Created on 2019-04-11 by the reprex package (v0.2.1) In stplanr you can currently do this as follows: library(stplanr)
r = line2route(flowlines_sf[2:3, ], route_fun = route_cyclestreet)
plot(r)
#> Warning: plotting the first 10 out of 17 attributes; use max.plot = 17 to
#> plot all Created on 2019-04-11 by the reprex package (v0.2.1) |
Dear Robin, thanks for your feedback! The openrouteservice routing API which In particular, querying for a list of routes is relatively simple to implement by the end user. In contrary, a vectorized package function might easily become complicated and quite obscure considering all the possible route configuration options. Because of that I don't see an urgent need for addressing this issue by designing a generic solution in the package. For now I would suggest that you consider providing a Cheers, |
That sounds reasonable - batch routing is a specific task that can make life more complicated so happy to approach this on the Many thanks for the reply, and excellent work on support for |
Great work @aoles many thanks. |
First to say: many thanks for a great package!
Wondering if you have plans to submit it to CRAN. Context: thinking of writing a wrapper, e.g.
route_ors()
, in stplanr. We've written some code here that uses it, rather inefficiently at the moment!: https://github.com/pedalea/pctSantiagoThe text was updated successfully, but these errors were encountered: