This discussion revolves around the fact that all three OSM-webpage routers are suggesting a strange maneuver to circumvent a right-turn prohibition. An explicit restriction with four via-ways to bypass this maneuver seems to be something the routers cannot process.
It appears to be a general problem that routers can circumvent turn-by-turn rules that don’t specify the four intersection segments (m,n,p,q) using from/to by driving in circles.
For example no_right_turn from b to g → b n q m p g
or (probably rarer) no_straight from b via n to d → b n q m p n d
Routers could solve this problem without adding extra restrictions if they knew which segments (ways) belong to the intersection. From my perspective, it would therefore be sensible to explicitly mark these segments (m,n,p,q) as an intersection, either as junction=? or by grouping them together using a relation.
What are your ideas? How to call this junction-type and how to mark the segments?
Otherwise if we have to use an explicit restriction e.g. “not from n via q, m to p” than how to call the restriction type (no_left/right/u-turn)? Should we add a no_loop restriction?
I know that there is a proposal to tag m,n,p and q with junction=intersection for this, but I’m personally more in favor of using an area or relation and also capture the extend of a junction, and maybe even add the traffic lights to it, so they are automatically grouped as well. But that might just be far too complicated.
But if used on a way, the logic would be to add a no_right_turn from b to g, and that would include b to g via only ways with junction=intersection, correct?
I guess the problem is that the restriction contains only ways and the ways form a closed loop. In this case the routing engines (Graphhopper, OSRM, OsmAnd) may not be able to rebuild the correct order of the ways. (The loop can formed in two directions if the oneway tag is not considered)
My own router assumes/requires the via member ways in any restriction relation to be ordered in the direction of travel. With this assumption/requirement, the direction of the forbidden loop is unambiguous.
My router is unaffected by the main issue of this topic because it never allows passing the same node multiple times in a route. However, there are imaginable cases where this is suboptimal.
I think the junction=intersection proposal is a convenient solution that allows the data consumer to auto-generate restrictions preventing loops within an intersection (but not other loops). In the provided example, I also don’t mind an explicitly mapped restriction for “do not circumvent right-turn restriction by looping” because this is a rather rare case.