opentripplanner / OpenTripPlanner

An open source multi-modal trip planner
http://www.opentripplanner.org
Other
2.21k stars 1.03k forks source link

living_street with cycleway:opposite has no car permission #5838

Closed hbruch closed 2 months ago

hbruch commented 6 months ago

Expected behavior

OSM way 89300522 with tags highway=living_street and cycleway:opposite should have ALL permissions.

Observed behavior

It has PEDESTRIAN_AND_BIKE permissions:

grafik

Testcase to reproduce

diff --git a/src/test/java/org/opentripplanner/openstreetmap/tagmapping/GermanyMapperTest.java b/src/test/java/org/opentripplanner/openstreetmap/tagmapping/GermanyMapperTest.java
index 00b1049bdd..178dea8ca9 100644
--- a/src/test/java/org/opentripplanner/openstreetmap/tagmapping/GermanyMapperTest.java
+++ b/src/test/java/org/opentripplanner/openstreetmap/tagmapping/GermanyMapperTest.java
@@ -263,6 +263,15 @@ public class GermanyMapperTest {
     assertEquals(wps.getDataForWay(steps).getPermission(), StreetTraversalPermission.PEDESTRIAN);
   }

+  @Test
+  void setCorrectPermissionsLivingStreetWithCyclewayOposite() {
+    // https://www.openstreetmap.org/way/89300522
+    var street = new OSMWithTags();
+    street.addTag("highway", "living_street");
+    street.addTag("cycleway", "opposite");
+    assertEquals(wps.getDataForWay(street).getPermission(), StreetTraversalPermission.ALL);
+  }
+
   @Test
   void testGermanAutobahnSpeed() {
     // https://www.openstreetmap.org/way/10879847

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

https://github.com/opentripplanner/OpenTripPlanner/commit/49436441cf399d12ce5bd051a874bcdee7ab9e30

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

http://download.geofabrik.de/europe/germany/baden-wuerttemberg/karlsruhe-regbez-latest.osm.pbf

Suspected Reason

The following code defines PEDESTRIAN_AND_BICYCLE as default permission, which is widened to ALL for many highway classes, but not living_street.

https://github.com/opentripplanner/OpenTripPlanner/blob/eced14ee6d8d8dfb24b644279fc09832ca590b41/src/main/java/org/opentripplanner/openstreetmap/tagmapping/DefaultMapper.java#L362-L365

github-actions[bot] commented 3 months ago

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days