Skip to content

GermanyMapper: roundabout way property resets bicycle safety of primary/secondary roads #8255

Open

Description

@MaxGosau

Expected behavior

A roundabout on a primary or secondary road keeps the bicycle safety of its road class in the
germany tag mapper, like it does in the default mapper. The roundabout mixins from
#8197 are then applied on top of that
(primary: 2.06 × 1.5 = 3.09).

Observed behavior

GermanyMapper defines the way property highway=*;junction=roundabout (BICYCLE_AND_CAR, used to
exclude pedestrians). With the best-match scoring it outranks the road-class property: 100 + 1
(wildcard) + 10 = 111 vs. 110 for highway=primary. The roundabout therefore starts from the
default bicycle safety of 1.0 instead of the road class value.

highway street roundabout (default mapper) roundabout (germany)
primary 2.06 3.09 1.50
secondary 1.50 2.25 1.50

(Values with PR 8197 applied; without it, the German roundabouts are 1.0.)

A roundabout on a primary road is rated safer for cycling than the road itself, so bike routes in
Germany are steered through large roundabouts.

Residential roundabouts are not affected: highway=residential;junction=roundabout sets 0.98
explicitly, the same value as plain residential.

Version of OTP used (exact commit hash or JAR name)

dev-2.x; measured on 3c3f0d45b8 (PR 8197 branch).

Data sets in use (links to GTFS and OSM PBF files)

Any German OSM extract; reproducible without data (see below).

Command line used to start OTP

N/A

Router config and graph build config JSON

build-config.json: "osmDefaults": { "osmTagMapping": "germany" }

Steps to reproduce the problem

In a test in package org.opentripplanner.osm.tagmapping:

var wps = new GermanyMapper().buildWayPropertySet();
var street = OsmWay.of().withTag("highway", "primary").build();
var roundabout = street.copy().withTag("junction", "roundabout").build();

wps.getDataForWay(street).forward().bicycleSafety();     // 2.06
wps.getDataForWay(roundabout).forward().bicycleSafety(); // 1.5, expected 3.09

Possible fix: keep the pedestrian restriction on German roundabouts, but stop that rule replacing
the road class's bicycle safety (e.g. a mixin that removes PEDESTRIAN instead of a way property).

Activity

  1. swamil-5504 commented on Dec 3, 2026

    @swamil-5504
    Contributor

    Hi @MaxGosau, are you planning to work on this yourself? If not, could I take a look at it? I'll wait to hear from you before I start.

  2. MaxGosau commented on Dec 4, 2026

    @MaxGosau
    ContributorAuthor

    @swamil-5504 doesnt have the highest prio for me, if you want to do it, go ahead :)

  3. swamil-5504 commented on Dec 4, 2026

    @swamil-5504
    Contributor

    @swamil-5504 doesnt have the highest prio for me, if you want to do it, go ahead :)

    Perfect , will look into this soon and if i have any questions will surely reach out to you, thanks!

  4. swamil-5504 commented on Dec 5, 2026

    @swamil-5504
    Contributor

    @MaxGosau I've opened a PR for the GermanyMapper roundabout fix: #8318

    Could you please have a look when you get a chance and let me know if you spot any issues or if any changes are needed? Thanks!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions