Skip to content

Add an option to avoid dual cariageways#1344

Open
swined wants to merge 1 commit intoosmandapp:masterfrom
swined:avoid_dual_carriageways
Open

Add an option to avoid dual cariageways#1344
swined wants to merge 1 commit intoosmandapp:masterfrom
swined:avoid_dual_carriageways

Conversation

@swined
Copy link
Copy Markdown

@swined swined commented Feb 18, 2026

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.

@swined
Copy link
Copy Markdown
Author

swined commented Feb 18, 2026

this pr fixes osmandapp/OsmAnd#23425

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant