Project-OSRM / osrm-backend

Open Source Routing Machine - C++ backend
http://map.project-osrm.org
BSD 2-Clause "Simplified" License
6.35k stars 3.36k forks source link

Provide an IntersectionValidationHandler #4146

Closed daniel-j-h closed 6 years ago

daniel-j-h commented 7 years ago

Our intersection handlers (and derived handlers such as the Sliproad handler) run in the osrm-extract tool for each internal intersection type. We should create a new (optional) handler running last which reports issues with the intersections and checks their integrity.

Issues we should detect and report (feel free to add more):

Here's the intersection handler:

https://github.com/Project-OSRM/osrm-backend/blob/9d308172949416701f375535c4a94c9291c4f283/include/extractor/guidance/intersection_handler.hpp#L29-L117

cc @joto @danpat

MoKob commented 7 years ago

There is quite a few other situations that we could also check easily:

emiltin commented 7 years ago

turns on railways would also be unexpected i think. mode change on roundabout could happen on a bike, if you have to push the bike on entry/exit.

MoKob commented 7 years ago

@emiltin are railway lines not modelling the actual tracks? In ferries there is an official OSM convention that different lines should use different ways, even though they might follow the same route for a while. On railways, I am not sure whether this is also the case. For the mode changes, I agree with you. We should make sure that we change this behaviour if we should be running the bike profile. Walk/Push should be at least kept out of the list of unexpected changes. We were only thinking of roundabouts directly connected into ferries (which was the case in a few situations)

b-jazz commented 7 years ago

I've done a couple hundred edits now for intersections that were caught by the "sharp turns onto ramps" validation and I've seen a non-trivial portion of them be false positives. In the area that I've worked on, there are on-ramps that are on the overpass or underpass that are "sharp" enough to be triggered and are typically controlled by a stop sign/light, but they all have a long ramp with plenty of time to get from 0 MPH to freeway merging speeds. I wonder if you can add another metric where you check the length of the on ramp and factor that into the decision. I can see a short ramp and a 20 degree angle is probably a problem with turn restrictions. But a 75 degree angle and a very long ramp probably is a false positive.

Just a thought.

daniel-j-h commented 7 years ago

That's great feedback! It should be possible to check this in the validation handler we have all the geometry at hand and can use it. I already experimented with checking only fast roads for sharp turns but that didn't turned out to be precise enough. Mostly because of missing road features such as traffic signals, stop signs, etc.

daniel-j-h commented 6 years ago

This got :hocho:-ed.