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

Routing with search radius as waypoints #3464

Closed
kaligrafy opened this issue Dec 16, 2016 · 8 comments
Closed

Routing with search radius as waypoints #3464

kaligrafy opened this issue Dec 16, 2016 · 8 comments

Comments

@kaligrafy
Copy link

kaligrafy commented Dec 16, 2016

I am building a genetic algorithm that creates transit bus routes using a list of predetermined stops. The algorithm has to try a lot of stops combinations to create optimal routes. The problem is if stops are placed away from the intersection, the routing results can create detours like shown on the first image (U-Turn are disabled for bus routing in my lua profile):

screen shot 2016-12-16 at 12 29 53

However, if the stop is placed just a bit on the right, the result is correct and optimal:

screen shot 2016-12-16 at 12 30 01

As mentioned in #930, would it be possible to search for the shortest path using all phantom nodes inside a circle? By instance, I give a location for the stop as a waypoint, than I choose the maximum radius using radiuses properties (say 100m), and the routing engine will find the best route inside the circle and ignore detours like the first image. In fact, the exact stop sign location would then be selected using the result output by the router. By the way, I cannot use bearings since the algorithm doesn't have a clue from where and to where the route is going before doing the routing.

Thanks for any help on this.

@TheMarex
Copy link
Member

Try using the map matching /match/v1/driving/{first};{second};{third}.json?radiuses=100;100;100 should basically give you exactly what you want.

@danpat
Copy link
Member

danpat commented Dec 16, 2016

Note that by default, the match plugin might split the result if the coordinates are > 2000m apart, but otherwise @TheMarex is right, that's probably the simplest way to get what you want.

@kaligrafy For your example - is there only one bus stop? Are you expecting the person to get off the bus at the intersection, cross the road, and get on a new bus line ?

@kaligrafy
Copy link
Author

@danpat The bus stop is not defined precisely, the algorithm tries multiple bus routes created by ordering a list of approximate stops to find optimal routes. After this process, the exact stop sign location can be determined for each route according to directions. I'll try the map matching, thanks!

@kaligrafy
Copy link
Author

Thanks it works perfectly! I just forgot that map matching returned duration and distance too, not just the matched path.

@TheMarex
Copy link
Member

Perfect! 👍

@kaligrafy
Copy link
Author

Just a question about this, how can we disable u-turn when matching? I disabled u-turns in the lua profile, but the matching response sometimes returns a path with u-turns. Is it possible to force a route with no u-turn?

@danpat
Copy link
Member

danpat commented Jan 11, 2017

@kaligrafy no, there's no parameter exposed to do that. The route service has continue_straight, but that's not available for match.

@kaligrafy
Copy link
Author

There is another problem I just faced: I need to force the matching to pass in the radius of every points (these are the bus stops). Sometimes, the routing ignores some points when there are too far apart, but I would need it to keep them even if the confidence stay low. Is that possible?

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

No branches or pull requests

3 participants