Osrm-backend: Support via-way restrictions for multiple vias

Created on 24 Aug 2017  Â·  10Comments  Â·  Source: Project-OSRM/osrm-backend

Over in https://github.com/Project-OSRM/osrm-backend/issues/2681, support was added for turn restricitons in OSM that use a way as the via.

In theory, it's possible to have multiple vias for a turn, although in practice they're pretty rare, most restructions are expressed with a single via way or node.

For completeness, we should support multiple vias for turn restrictions.

Feature Request

Most helpful comment

This issue seems to be a lot more urgent now as "multiple via way" restrictions are about to become quite common as the updated turn restriction editor in iD creates them by default.

Here is a restriction that the updated turn restriction editor in iD created 2 days ago simply by clicking the appropriate "NO U-Turn" symbol in the editor:
https://www.openstreetmap.org/relation/8082503

And here is OSRM ignoring it:
https://www.openstreetmap.org/directions?engine=osrm_car&route=-27.22981%2C153.02138%3B-27.23005%2C153.02133#map=19/-27.22996/153.02177

Any chance to support these in OSRM soon?

All 10 comments

@danpat ✋ I'm really waiting for that moment when this feature would be implemented.
It will help to avoid adding tonnes of excessive TRs 🙄 👉 https://www.openstreetmap.org/#map=19/33.85192/-84.36983

java openstreetmap editor 2017-11-15 21-33-26

/cc @daniel-j-h

@Andygol This ticket is open, but we have no plans to work on it for a while.

Quick question about the modelling at this location. The highlighted node:

screen shot 2017-11-15 at 9 32 57 pm

has two via roles in turn restrictions. You could achieve the same result by simply disconnecting these ways.

You could achieve the same result by simply disconnecting these ways.

Yeah, I know this approach. If we remove this node in order to disconnect the lines, this place will appear in one of the way-crossing validators and the point will be added again - this is not a solution to the problem.

The main goal is to encourage mappers to follow up our mapping guides and establish them as the best practices among OSM community. But without supporting multi-vias turn restriction it is hard to push this approach for mapping activities.

This is suggested mapping of SPI-junctions 👇

java openstreetmap editor 2017-11-09 16-42-54

This issue seems to be a lot more urgent now as "multiple via way" restrictions are about to become quite common as the updated turn restriction editor in iD creates them by default.

Here is a restriction that the updated turn restriction editor in iD created 2 days ago simply by clicking the appropriate "NO U-Turn" symbol in the editor:
https://www.openstreetmap.org/relation/8082503

And here is OSRM ignoring it:
https://www.openstreetmap.org/directions?engine=osrm_car&route=-27.22981%2C153.02138%3B-27.23005%2C153.02133#map=19/-27.22996/153.02177

Any chance to support these in OSRM soon?

I am experiencing the same issue mentioned by @eFrysTon too!. Any updates?

For what it’s worth, there appear to be just over a thousand turn restriction relations containing multiple via ways. (The query isn’t foolproof; I see a lot of defective restriction relations in there.)

Well, may main point was that the graphic turn restriction editor in iD is now creating them with a single click without it even being noticeable that it's a multi-way via restriction or any indication that support for these is still lackluster in available routing engines. Which means they are likely to proliferate in the future.

@eFrysTon the holdup here is that the implementation is not trivial, and is relatively low priority when there aren't that many of these things out there yet.

The way OSRM models the road network as a graph makes it easy to support via-node restrictions (we simply delete an edge and the turn is no longer possible). For via-single-way restrictions, some "tricks" have been implemented, but can't be extended to support the multiple via way restrictions.

Supporting multi-via-way restrictions very likely requires some quite complicated graph transformation/expansion around intersections with multi-via-way restrictions.

As always, pull requests implementing the feature from the community are very welcome :-)

Hi, I have a maybe silly question: is there any via-way(s) restriction in real-world road network? (I don't have a driving license yet :( )

I mean it seems most of via-ways restriction in OSM is a side product caused by a single physical intersection being divided into multiple OSM nodes.

For example, a classic # shape road, to disable a u-turn then a via-ways restriction is needed. But if we can treat these 4 nodes as a "big intersection node", then a simple "via-big-node" restriction should be sufficient.

But of course, if there really has some kind of via-way(s) restriction in real-life then this "big intersection" approach will be insufficient.

I have modelled this forbidden route as a restriction of multiple via ways:

https://www.openstreetmap.org/relation/7139227#map=17/22.27908/114.18234

None of the OSM routers obey this restriction, but most commercial providers (with Google the most notable exception, where a lot of drivers followed and get caught by police) can avoid it correctly.

Is there any better method for that?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ardanika picture ardanika  Â·  3Comments

zifeo picture zifeo  Â·  3Comments

ifle picture ifle  Â·  5Comments

grib0 picture grib0  Â·  4Comments

koussaimb picture koussaimb  Â·  4Comments