Add an option to avoid dual cariageways#1344
Open
swined wants to merge 1 commit intoosmandapp:masterfrom
Open
Conversation
Author
|
this pr fixes osmandapp/OsmAnd#23425 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds an option to avoid dual carriageways, the roads that look like motorways, albeit not being marked as such. Excluding them usually yields a more scenic route, which can be greatly appreciated by car enthusiasts and motorcyclists.
The implementation relies on a combination of tags. It only excludes one way sections of trunk roads (and motorways, if not excluded already). Neither of the tags alone indicates that a road is a dual carriageway, but such a combination of them seems to quite reliably predict it across multiple countries it has been tested in.
Lower class roads rarely have long enough stretches of dual carriageway to matter, while excluding them from the filter avoids a huge amount of noise from traffic islands and such. Also the lowest class roads, while sometimes technically being a dual carriageway, are hardly the kind of a dual carriageway that is meant to be avoided, like divided residential roads.
Given that some stretches of the trunk roads can be genuinely one way, or can be just a short divided section of an otherwise two way road, the priority for them has to be low enough to avoid genuine dual carriageways, while being high enough to pass those short sections without having to do a detour each time there is a traffic calming island on the way.
On top of that, all junctions, bridges and tunnels are excluded from the filter. Excluding junctions allows free access through roundabouts both when moving along the road, and when crossing a higher level road that the roundabout can belong to. Bridges and tunnels are excluded because they are much more likely to have divided sections regardless of the type of road they are part of.