File tree Expand file tree Collapse file tree
main/java/org/opentripplanner/osm/tagmapping
test/java/org/opentripplanner/osm/tagmapping Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212import org .opentripplanner .framework .functional .FunctionUtils .TriFunction ;
1313import org .opentripplanner .osm .model .OsmEntity ;
1414import org .opentripplanner .osm .wayproperty .WayPropertySet ;
15+ import org .opentripplanner .osm .wayproperty .specifier .Condition .Equals ;
16+ import org .opentripplanner .osm .wayproperty .specifier .Condition .Not ;
17+ import org .opentripplanner .osm .wayproperty .specifier .ExactMatchSpecifier ;
1518import org .opentripplanner .street .model .StreetTraversalPermission ;
1619
1720/**
@@ -182,7 +185,13 @@ else if (speedLimit <= 16.65f) {
182185
183186 // Typically if this tag is used on a way, there is also a better option for walking.
184187 // We don't need to set bicycle safety as cycling is not currently allowed on these ways.
185- props .setMixinProperties ("bicycle=use_sidepath" , ofWalkSafety (5 ));
188+ props .setMixinProperties (
189+ new ExactMatchSpecifier (
190+ new Not (new Equals ("foot" , "use_sidepath" )),
191+ new Equals ("bicycle" , "use_sidepath" )
192+ ),
193+ ofWalkSafety (5 )
194+ );
186195
187196 // Automobile speeds in Finland.
188197 // General speed limit is 80kph unless signs says otherwise.
Original file line number Diff line number Diff line change @@ -174,6 +174,11 @@ void testUseSidePath() {
174174 assertEquals (9 , wps .getDataForWay (wayWithBicycleSidePath ).forward ().walkSafety (), EPSILON );
175175 var wayWithFootSidePath = OsmWay .of ().withTag ("foot" , "use_sidepath" ).build ();
176176 assertEquals (9 , wps .getDataForWay (wayWithFootSidePath ).forward ().walkSafety (), EPSILON );
177+ var wayWithBoth = OsmWay .of ()
178+ .withTag ("foot" , "use_sidepath" )
179+ .withTag ("bicycle" , "use_sidepath" )
180+ .build ();
181+ assertEquals (9 , wps .getDataForWay (wayWithBoth ).forward ().walkSafety (), EPSILON );
177182 }
178183
179184 @ Test
Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ Multiple mixins can apply to the same way and their effects compound.
127127
128128| matcher | add permission | remove permission | bicycle safety | walk safety |
129129| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -------------------| ------------------------| -----------------------------------------------------| -------------|
130- | ` bicycle=use_sidepath ` | | | | 5.0 |
130+ | ` not(foot=use_sidepath); bicycle=use_sidepath` | | | | 5.0 |
131131| ` motorroad=yes ` | | PEDESTRIAN_AND_BICYCLE | | |
132132| ` cycleway=lane; not(highway=cycleway) ` | BICYCLE | | 0.87 | |
133133| ` cycleway=share_busway; not(highway=cycleway) ` | BICYCLE | | 0.92 | |
You can’t perform that action at this time.
0 commit comments