Closed ghost closed 6 years ago
That's not supported at the moment. This is kind of by design for the router because it would sometimes prefer u-turns instead of "natural" routes. To illustrate this, see the image below where the design prefers A over B.
Note: intersection = blue bullet, position sample = numbered diamond, road segment = black line, route = orange line
However, I understand your case because it means that it also prefers C over D which is unnatural too. I could try out (so success is not guaranteed) a quick fix with a simple logic: For each determined transition (route) check its sequence of roads if it includes the opposite side segment of the start segment and if so, cut the route appropriately. That means it prefers then D over C but also still A over B. What do you think? Does it make sense to you?
Yes, this is exactly what we need. With one more condition - if the position is near (e.g. < MaxRadius) the junction then leave the logic as is and don't cut the road. Thank you in advance.
This is addressed in PR #108. I'm closing this issue now.
When a U-turn is made not on a junction but on the middle of the road, the path reported by the matching algorithm is to the end of the road segment and back to current position. In this case the calculated distance is much greater (in some cases more than 1 km) than the actual traveled distance. Is it possible to split the road segment and make the switch in direction at some point near to actual U-turn. I'm providing a picture and test data.
points-1.txt