I’m trying to find the most likely route between 2 bus stops, but sometimes the stops coordinates are off the road and it goes some extra miles, sometimes leading to u-turns which of course are not recommended for buses.
I tried to disable u-turn by following the documentation, with no success:
val request: GHRequest = GHRequest(shape.lat, shape.lng, nextShape.lat, nextShape.lng) .setProfile(profile) .putHint(Parameters.CH.DISABLE, true) .putHint(Parameters.Routing.PASS_THROUGH, false) .putHint(Parameters.Routing.HEADING_PENALTY, 300)
Here is an exemple of what I want to avoid:
Waypoint 1 is a little bit off the road and GH tries to be as close as possible, but leading to a u-turn.
This is what I would like (I faked the Waypoint position for the example):
I think my issue is the same as Forbidding U-Turns - possible? but I can’t seem to get it to work for me.
What am I missing? What configuration could I use for my purpose?