Skip to content
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

osrmRoute with via points #41

Closed
rCarto opened this issue Mar 25, 2019 · 13 comments
Closed

osrmRoute with via points #41

rCarto opened this issue Mar 25, 2019 · 13 comments

Comments

@rCarto
Copy link
Member

rCarto commented Mar 25, 2019

Hello.
How do I add location along the path of travel so that I can get my route plotted at those points as well.
I'd appreciate a solution to this question. Thanks'

Originally posted by @Anyaoha in #33 (comment)

@rCarto
Copy link
Member Author

rCarto commented Mar 25, 2019

This is not possible in osrm yet. OSRM server allow to pass several points in the route service.

@rCarto rCarto mentioned this issue Mar 25, 2019
@Anyaoha
Copy link

Anyaoha commented Mar 26, 2019

Thanks @rCarto.

I have two questions, and I would appreciate if you can get me answers to the best of your knowledge.

Is it possible to plot road routes which are on osrm using leaflet or mapview?
How do I extend the number of co-ordinates to be routed over 100 points on osrm

@rCarto
Copy link
Member Author

rCarto commented Mar 26, 2019

  1. A simple example to plot routes with mapview:
library(osrm)
# Travel path between points between points - output a SpatialLinesDataFrame
route <- osrmRoute(src = c("A", 13.43853, 52.47728),
                   dst = c("B", 13.32247, 52.48882),
                   sp = TRUE, overview = "full")
library(mapview)
mapview(route)

Displaying the underlying OSRM road network is not possible. You can have a look at the osmdata package.

  1. Getting routes with via points implies modifying the code of the osrmRoute() function. I'll have a look into that feature as soon as possible.

@rCarto rCarto closed this as completed Mar 26, 2019
@rCarto rCarto reopened this Mar 26, 2019
@Anyaoha
Copy link

Anyaoha commented Mar 27, 2019

@rCarto I had plotted the routes of some locations. The maximum number of locations allowed for routing using the OSRM is 100 coordinate points.

Kindly let me know if you get some findings on expanding this restriction.
Thanks

1 similar comment
@Anyaoha
Copy link

Anyaoha commented Apr 2, 2019

@rCarto I had plotted the routes of some locations. The maximum number of locations allowed for routing using the OSRM is 100 coordinate points.

Kindly let me know if you get some findings on expanding this restriction.
Thanks

@Anyaoha
Copy link

Anyaoha commented Apr 2, 2019

I don't know how the R studio module works. If it's making requests to the OSRM demo server at https://router.project-osrm.org/, then you'll need to learn how to install and build OSRM separately, then run osrm-routed with the option I posted above.

_Originally posted by @danpat in Project-OSRM/osrm-backend#5421 (comment)

@rCarto What do you think of this?
I think there's a way here. Do you think you can make this happen?

@rCarto
Copy link
Member Author

rCarto commented Apr 2, 2019

The osrm package use an OSRM server. The default server has limitations. You can run your own instance of OSRM server (via docker) with the described options to get rid of the limitations and make osrm package use your server.

@rCarto rCarto closed this as completed Apr 2, 2019
@Anyaoha
Copy link

Anyaoha commented Apr 2, 2019

That’s why I reached out to you @rCarto.
How can I get this done using R

@rCarto
Copy link
Member Author

rCarto commented Apr 2, 2019

As stated in the documentation, to change the OSRM server, change the osrm.server option:

options(osrm.server = "http://address.of.the.server/")

@Anyaoha
Copy link

Anyaoha commented Apr 5, 2019

Thanks @rCarto I got osrm to work using the local host. I can now use the osrmTablefor more than 100 coordinate points but I have concerns about osrmTrip because I still get errors of The OSRM server returned an error: Error: TooBig Too many trip coordinates when I try to use in for analysis greater than 100 coordinates.
I need help please.

@rCarto
Copy link
Member Author

rCarto commented Apr 5, 2019

Hmm, there may be an other option to set on the server side. I would search on the OSRM engine documentation.

@Anyaoha
Copy link

Anyaoha commented Apr 6, 2019

I have set it already. Thanks

For those who would like to get solution from my experience.
Here's how I got it done.
osrm-routed --max-trip-size X map.xml.osrm where X is the size you'd like to use.

@rCarto
Copy link
Member Author

rCarto commented Sep 23, 2019

version 3.3.2 should address the original question

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants