OpenStreetMap

Sharp Turns onto Ramps

Posted by daniel-j-h on 23 June 2017 in English (English)

Here's a map I got out of our Open Source Routing Machine when I built a validator for sharp turns onto ramps. The idea behind this validator is that turns onto highway ramps should never be sharp (i.e. < 90'ish degree). There is a high chance a turn restriction is missing at those locations.

With these checks enabled I found roughly 30k intersections on the planet. I visualized the results in the map below; the redder the circle, the sharper the turn angle onto the ramp.

Click for interactive map

In the results I found an issue that frequently re-occurred. Consider the situation below: heading east on Goff Mountain Road (the yellow line), there is a ramp on the right that you can legally take. Around the bend, there is another ramp onto the same road for drivers going west on Goff Mountain Road.

If you are driving east on Goff Mountain Road and happen to miss the ramp, re-routing will kick in. When generating a new route past the ramp that you initially missed, OSRM sees in the road network that there is conveniently a second ramp onto the same road. It then basically gives you the instruction to make a nearly 180 degree turn on the the next ramp! A turn restriction onto that second ramp from Goff Mountain Road would fix this issue.

Given that the navigation is able to pass in your bearings data (what cardinal direction you’re already moving in) to OSRM, OSRM won’t try and tell you to make a fast u-turn and try the first ramp again like in the third frame of the gif. Making a turn onto the second ramp isn’t considered problematic though.

There are definitely false positives in the data and cases you will never hit in reality. But there are also missing turn restrictions onto ramps that will result in bizarre instructions given back to re-routing requests.

And even though the sharp-turns-onto-ramps validator was just a quick evening hack it would be great to add more static road network property validators that detect situations like u-turns on high-speed roads or sudden changes in road class.

Comment from Piskvor on 23 June 2017 at 14:47

Excellent, excellent! Looking at my area, I see some sharp turns highlighted; is there a way to get to them from your map (other than "open up the same area in JOSM and look for cues")?

Hide this comment

Comment from ff5722 on 23 June 2017 at 19:35

If you could give the WMTS link from the Mapbox style it can be used as a background layer in JOSM (for iD, Leaflet works). Then it's easy to download that area from OSM right away.

Hide this comment

Comment from Piskvor on 23 June 2017 at 20:10

Alas, I'm not looking for the Mapbox background layer, but for the "circles" overlay. That's not a part of the tiles.

Hide this comment

Comment from aharvey on 23 June 2017 at 22:55

It's all part of the same style (circles included) just add the style WMTS URL like this into JOSM as a WMTS layer.

https://api.mapbox.com/styles/v1/danieljh/cj42l3yw05epa2sqvellka881/wmts?access_token=pk.eyJ1IjoiZGFuaWVsamgiLCJhIjoiTnNYb25JSSJ9.vYOnsuu1zeKcGW2nj0uJZw

If you ONLY want the circle and not the basemap as well, you would need to create your own Mapbox style from that style but remove all layers except the circles.

Hide this comment

Comment from robert on 25 June 2017 at 20:29

Inspired!

Hide this comment

Comment from Franky63 on 26 June 2017 at 08:45

thank you!

Hide this comment

Comment from Piskvor on 26 June 2017 at 09:06

@aharvey: Excellent, thank you!

Hide this comment

Comment from daniel-j-h on 27 June 2017 at 10:20

You can also find the raw GeoJSON for the initial run on the planet in this ticket:

https://github.com/Project-OSRM/osrm-backend/pull/4160#issuecomment-309253836

it will probably change with time when refining the check and adding more features to it.

Hide this comment

Comment from Niels Elgaard Larsen on 30 June 2017 at 15:19

Great job.

When will you run it again and update the map?

I believe we fix most of the issues in Denmark, and it would be interesting to see if the rest are false positives or problems with the mapping.

I do think there is a few false positives for motorway_links that are not one-way.

Hide this comment

Comment from b-jazz on 3 July 2017 at 17:17

This is fantastic. Thanks for the great analysis that will help serve to make OSM better and better. I've been cleaning up some of the ones in my area.

It would be great if there were a way to tag false positives so they won't continue to be tagged in the future.

Hide this comment

Comment from daniel-j-h on 3 July 2017 at 19:20

I will run the same validation handler and a new one on the planet tomorrow or the day after and will post back with new GeoJSON data and a map.

It would be great to find false positive categories. For example some of the locations I samples had a stop sign missing and were actual legal turns.

If there are false positives which we can detect from the OpenSTreetMap data I'm more than happy to implement this in OSRM.

Hide this comment

Comment from gorn on 9 July 2017 at 09:49

OK, you made my Sunday. Going to correct Czechia :)

Hide this comment

Comment from Piskvor on 9 July 2017 at 10:03

Is there a way to map false positives (@gorn: e.g. the turn @ Bertramka is indeed legal, passable and used, despite the sharp angle)

Hide this comment

Comment from gorn on 9 July 2017 at 11:28

I started to map Czechia and found these false positives at first

But than I started to see that most of the places in Czechia (and I think this is valid for most of Europe at least for the Countries I visited) will be FALSE positives by principal. Most of the "regular" junctions with motorway (not counting the big complex ones) will look like this

https://api.mapbox.com/styles/v1/danieljh/cj42l3yw05epa2sqvellka881.html?access_token=pk.eyJ1IjoiZGFuaWVsamgiLCJhIjoiTnNYb25JSSJ9.vYOnsuu1zeKcGW2nj0uJZw#16.9/49.72333/13.356

Where there is NO place for your scenario. Even thought the turn to motorway link might be < 90 deg for one of the directions (it will be unless is it exactly 90). There is no reason to think it is a mistake. You should at least check the onway tag.

More sophisticated applrpoach would be to to detect if the are TWO options how to get on the motoway - if there is only one, it is highely probable that it will be accessible from both directions unless the angle is really small.

Hide this comment

Comment from gorn on 9 July 2017 at 11:44

Please not that still I did some nice mapping based on your data, so thanks a lot and I wonder if you will be able to correct the problem, because I see similar navigational problems every since and than and it is nice to see some systematic approach to them.

BTW there is another typical junction (used more for smaller roads) with no space for you scenario

https://api.mapbox.com/styles/v1/danieljh/cj42l3yw05epa2sqvellka881.html?access_token=pk.eyJ1IjoiZGFuaWVsamgiLCJhIjoiTnNYb25JSSJ9.vYOnsuu1zeKcGW2nj0uJZw#16.26/50.52168/13.54504

Hide this comment

Comment from daniel-j-h on 9 July 2017 at 18:03

Where there is NO place for your scenario. Even thought the turn to motorway link might be < 90 deg for one of the directions (it will be unless is it exactly 90). There is no reason to think it is a mistake. You should at least check the onway tag.

We do check the oneway tag - not even that but we check hopefully most if not all routing related tags; if you find a tag missing please open an issue in

https://github.com/Project-OSRM/osrm-backend/issues.

The location you pointed out is problematic mostly because of this turn:

http://map.project-osrm.org/?z=18&center=49.723316%2C13.355816&loc=49.723387%2C13.356231&loc=49.723484%2C13.355427&hl=en&alt=0

If you have a look at how the intersection is modeled in OpenStreetMap:

https://www.openstreetmap.org/edit?way=139088393#map=19/49.72327/13.35573

and now compare it to reality by looking at the satellite imagery.

In this case all the routing engine sees from the data is a sharp turn onto a ramp; that the intersection here should be modeled out more detailed is something the routing engine can not tell.

Hide this comment

Comment from daniel-j-h on 12 July 2017 at 08:45

We refined some checks and added new ones for sharp turns (e.g. sharp turns from one ramp onto another). Here are up-to-date results for the planet:

https://api.mapbox.com/styles/v1/danieljh/cj4zptszf0xgl2srvbsseiwjw.html?access_token=pk.eyJ1IjoiZGFuaWVsamgiLCJhIjoiTnNYb25JSSJ9.vYOnsuu1zeKcGW2nj0uJZw#6.22/51.134/11.663

Colored as follows:

  • < 45 degree #e55e5e (red)
  • < 65 degree #f9886c (orange)
  • < 85 degree #fbb03b (yellow)
Hide this comment

Comment from b-jazz on 22 July 2017 at 19:06

Are there plans to update this on a regular basis. I try to poke around a clean up a few of the sharp turns when I have some time on my hands, but it is getting to the point where I run into ones that I've already updated, but they are still on the map. I'd love to see daily updates if it isn't too difficult.

I'm also curious at how things have changed with the map since you first started the project. There were ~30,000 at the start. I'm guessing the number has dropped since then (partly due to re-jiggering the methodology and partly due to people cleaning the data). But it would still be interesting to see how effective your project has been.

Hide this comment

Leave a comment

Parsed with Markdown

  • Headings

    # Heading
    ## Subheading

  • Unordered list

    * First item
    * Second item

  • Ordered list

    1. First item
    2. Second item

  • Link

    [Text](URL)
  • Image

    ![Alt text](URL)

Login to leave a comment