Skip to content

Keep road class bicycle safety on German roundabouts - #8318

Open
swamil-5504 wants to merge 1 commit into
opentripplanner:dev-2.xfrom
swamil-5504:fix/germany-roundabout-bicycle-safety
Open

swamil-5504 wants to merge 1 commit into
opentripplanner:dev-2.xfrom
swamil-5504:fix/germany-roundabout-bicycle-safety

Conversation

@swamil-5504

@swamil-5504 swamil-5504 commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The roundabout rules in GermanyMapper replaced the way properties of the road class. Every non-residential roundabout became BICYCLE_AND_CAR with default safety. As a result:

  • the bicycle safety of the road class was lost
  • motorway roundabouts got bicycle access
  • cycleway roundabouts got car access
  • footway roundabouts lost pedestrian access

This PR replaces those rules with a mixin. The mixin only removes pedestrian access on roundabouts of major roads that have no foot tag. The road class properties and the general roundabout safety factors now apply.

Issue

No separate issue was created. This is a small bugfix.

The two rules highway=residential;junction=roundabout and highway=*;junction=roundabout are removed. A mixin replaces them and matches roundabouts where:

  • junction=roundabout
  • highway is one of primary, primary_link, secondary, secondary_link, service, tertiary, tertiary_link, trunk, trunk_link or unclassified
  • there is no foot tag

The mixin only removes PEDESTRIAN permission. It doesn't replace the way properties, so roundabouts keep their road class permissions and bicycle safety. The general roundabout safety factors are applied on top. The residential roundabout rule (ALL, bike safety 0.98) gave the same values as the residential road class, so removing it changes nothing.

Unit tests

New tests in GermanyMapperTest:

  • roundaboutKeepsRoadClassBicycleSafety: a primary roundabout keeps the bike safety of its road class (2.06), and the roundabout factor is applied on top (3.09).
  • roundaboutWithExplicitFootAccessAllowsPedestrians: a primary roundabout tagged foot=yes keeps ALL permission.
  • footwayRoundaboutAllowsPedestrians: a footway roundabout keeps PEDESTRIAN permission.

Documentation

A code comment explains why pedestrian access is removed and why a mixin is used. The generated doc/user/osm/Germany.md is updated: the two roundabout rules are gone from the way properties table, and the new mixin is in the mixins table. No configuration options were added.

The GermanyMapper roundabout rules replaced the road class's way
properties: every non-residential roundabout became BICYCLE_AND_CAR with
default safety. This dropped the road class bicycle safety and gave
motorway roundabouts bicycle access, cycleway roundabouts car access and
footway roundabouts no pedestrian access.

Replace them with a mixin that only removes pedestrian access on
roundabouts of major roads without a foot tag, so the road class
properties and the general roundabout safety factors apply.
@codecov

codecov Bot commented Dec 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.20%. Comparing base (d2091ed) to head (9a9791f).
⚠️ Report is 1 commits behind head on dev-2.x.

Additional details and impacted files
@@              Coverage Diff              @@
##             dev-2.x    #8318      +/-   ##
=============================================
- Coverage      76.20%   76.20%   -0.01%     
+ Complexity     24904    24901       -3     
=============================================
  Files           2671     2671              
  Lines          93274    93273       -1     
  Branches        9293     9293              
=============================================
- Hits           71080    71075       -5     
- Misses         19051    19052       +1     
- Partials        3143     3146       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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