Repository navigation
Use road class to determine if a fork should have an instruction - #1844
Conversation
|
Due to the recent fix in #1845 this is working fine now. WDYT? Do we need to add anything here? |
karussell
left a comment
There was a problem hiding this comment.
Thanks, looks good :)
Only one minor thing.
|
In the following situation the second continue instruction is removed (see MapMatchingTest.testDoWork): So, before there were 2 instructions: "continue onto Windmühlenstraße" and "continue onto Bayrischer Platz" and now there is just the first instruction. This is an improvement IMO as the road name changes on a non-junction node and so the instruction is unnecessary. But could there be instructions removed due to this PR although the road name changes directly on a junctions? Personally I would prefer to keep these instructions to make navigation clear in a dense area. |
boldtrn
left a comment
There was a problem hiding this comment.
But could there be instructions removed due to this PR although the road name changes directly on a junctions?
Yes this could happen in some rare scenarios.
Our, "most complicated" case to decide if an instruction is needed or not is at a potential fork. A potential fork is an intersection where at least two roads more or less continue in the same direction as the previous road. Before, if just a minor attribute changed between the previous and the current edge, we created an instruction. Therefore, we have seen so many instructions on motorways.
One indication that we need an instruction at a fork, is a changing road name. This approach doesn't work well on motorways for example, because often all edges have the same name. On rural roads, often the short edges between two linking roads don't have a name attached (or miss the maxspeed tag, etc.), which also leads to undesired instructions.
So essentially one of the changes in this PR is to check the road class. If the current road is a main road ((roadClass == RoadClass.MOTORWAY || roadClass == RoadClass.TRUNK || roadClass == RoadClass.PRIMARY || roadClass == RoadClass.SECONDARY || roadClass == RoadClass.TERTIARY)), and we are staying on the same road class, where the other road is a different road class (including _link), then we very likely don't need an instruction.
There are certainly edge cases when this approach does not work.
Personally I would prefer to keep these instructions to make navigation clear in a dense area.
In my opinion, we should only provide an instruction if the user has to change something, like turning, switching lanes, etc., if the user only needs to follow the road, no instruction should be provided. Especially in dense areas, if you tell a user to "continue on street a", the user will start to look for street signs with "street a". Finding street signs can be quite hard sometimes and removes attention from the important task of driving.
Yes, in theory I agree. The problem in practice is that often junctions are not perfectly mapped and so omitting continue instructions for the inner-city case could be problematic if the road name changes. But we'll see what feedback we'll get. Just wanted to understand the now failing map matching test and will now just adapt to the new instructions. |
|
Yes that makes perfect sense :). Let's see what people think. Unfortunately in the real world there are so many different scenarios and you cannot easily test them without knowing the actual situation. |
This PR solves #990 and #1047.
Essentially, this will remove many unnecessary instructions on main roads, including the annoying continue instructions on motorways. For minor roads the difference should be rather small.
Something I am not sure about is how we should handle the tagged maxspeed. Often no maxspeed is tagged. Currently I decided to fallback to the average speed.
Let me know how this works out in your tests and if there are any cases we need to improve.
Here is a brief comparison of GH maps route vs. the improved version, I think the difference is quite visible :)):


BTW: I stumbled over #1843 while creating this PR