valhalla / valhalla

Open Source Routing Engine for OpenStreetMap
https://valhalla.github.io/valhalla/
Other
4.51k stars 682 forks source link

Exit with two lanes is possibly considered as highway split and results in fork / stay left #3921

Open SamuelBrucksch opened 1 year ago

SamuelBrucksch commented 1 year ago

Here you can see the exit on mapillary: https://www.mapillary.com/app/?lat=49.307336388889&lng=8.6279380555556&z=17&focus=photo&pKey=497434221576312&x=0.39252234290766874&y=0.5196889481325677&zoom=0 First it starts with one lane, then later on it changes to two lanes: https://www.mapillary.com/app/?lat=49.30549802788&lng=8.6274665804&z=17&focus=photo&pKey=576515749975959

However the road after that is really an exit: image

If you take the exit, it is shown correctly: image

But if you go straight, it shows it as stay left: image

Maybe there is a logic, to mark it as fork, if more than one lanes go off, but in this case it is wrong. I did not find many other off ramps with two lanes yet, so maybe this is a special case, but i can't imagine, that there are no other off ramps like this. Here from the json:

          {
            "type": 24,
            "instruction": "Keep left to stay on A 5/E 35.",
            "verbal_transition_alert_instruction": "Keep left to stay on A 5.",
            "verbal_pre_transition_instruction": "Keep left to stay on A 5, E 35.",
            "verbal_post_transition_instruction": "Continue for 400 meters.",
            "street_names": ["A 5", "E 35"],
            "time": 13.148,
            "length": 0.383,
            "cost": 12.813,
            "begin_shape_index": 11,
            "end_shape_index": 16,
            "highway": true,
            "travel_mode": "drive",
            "travel_type": "car"
          },

I think this intersection should be treated like other exits / off ramps too, where no stay left is shown. The street marking also clearly indicates, that the 2 lanes to the right are not part of the main road, as the markings between the off ramp and the highway lanes is wider, which indicates it is not part of the highway anymore, but it belongs to the link road. Also it is very straight and the route line also clearly follows the road. I think in this case no instruction should be shown.

Unfortunately the demo server does not seem to work properly, so i can't link directly, but here are the coordinates: start: 8.628682, 49.310337 destination: 8.624842, 49.294117

If there is anything else i can help with, let me know.

nilsnolde commented 1 year ago

I have no real experience with the navigation tbh, @dgearhart or @kevinkreiser are an infinitely more knowledgeable authority, but I'd bet it's the OSM data somehow? I do know that Valhalla has a very sophisticated narration engine. Could you please give us the URL for that intersection on openstreetmap.org?

SamuelBrucksch commented 1 year ago

https://www.openstreetmap.org/way/143868865

kevinkreiser commented 1 year ago

the exit seems tagged correctly https://www.openstreetmap.org/node/90636873 the off ramp seems tagged correctly https://www.openstreetmap.org/way/143871074 the only interesting thing i see is that there is also tagged a relation (but as a detour) for A5: https://www.openstreetmap.org/relation/399059

even though its marked as a "detour" that relation still has type as route. i wonder if our parsing upgrades the ramp to a shielded route because of this and then odins maneuver generation (https://github.com/valhalla/valhalla/blob/master/src/odin/maneuversbuilder.cc) says oh well that exit is shielded so its a fork not an exit ramp. if that is the case then all we need to do is at parsing time, when a route relation is tagged as detour or other such disqualifiying or conditional things that would make it not-really-a-shielded-route and ignore it as a route relation, probably just a lua change but possibly also maybe some code in pbfgraphparser (probably just lua though). this would be interesting to write a gurka test for!