Commit 2d464da 1 parent 30dee5f commit 2d464da Copy full SHA for 2d464da
File tree 2 files changed +22
-0
lines changed
main/java/org/opentripplanner/openstreetmap/tagmapping
test/java/org/opentripplanner/openstreetmap/tagmapping
2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 1
1
package org .opentripplanner .openstreetmap .tagmapping ;
2
2
3
+ import static org .opentripplanner .openstreetmap .wayproperty .MixinPropertiesBuilder .ofWalkSafety ;
3
4
import static org .opentripplanner .openstreetmap .wayproperty .WayPropertiesBuilder .withModes ;
4
5
import static org .opentripplanner .street .model .StreetTraversalPermission .ALL ;
5
6
import static org .opentripplanner .street .model .StreetTraversalPermission .CAR ;
@@ -163,6 +164,12 @@ else if (speedLimit <= 16.65f) {
163
164
props .setProperties ("highway=service;tunnel=yes;access=destination" , withModes (NONE ));
164
165
props .setProperties ("highway=service;access=destination" , withModes (ALL ).bicycleSafety (1.1 ));
165
166
167
+ // Typically if this tag is used on a way, there is also a better option for walking.
168
+ // We don't need to set bicycle safety as cycling is not currently allowed on these ways.
169
+ props .setMixinProperties ("bicycle=use_sidepath" , ofWalkSafety (5 ));
170
+
171
+ props .setMixinProperties ("foot=use_sidepath" , ofWalkSafety (8 ));
172
+
166
173
// Automobile speeds in Finland.
167
174
// General speed limit is 80kph unless signs says otherwise.
168
175
props .defaultCarSpeed = 22.22f ;
Original file line number Diff line number Diff line change @@ -162,6 +162,21 @@ public void testSafetyWithMixins() {
162
162
wps .getDataForWay (wayWithMixinsAndCustomSafety ).walkSafety ().forward (),
163
163
epsilon
164
164
);
165
+
166
+ OSMWithTags wayWithBicycleSidePath = new OSMWithTags ();
167
+ wayWithBicycleSidePath .addTag ("bicycle" , "use_sidepath" );
168
+ assertEquals (
169
+ 8 ,
170
+ wps .getDataForWay (wayWithBicycleSidePath ).walkSafety ().forward (),
171
+ epsilon
172
+ );
173
+ OSMWithTags wayWithFootSidePath = new OSMWithTags ();
174
+ wayWithFootSidePath .addTag ("foot" , "use_sidepath" );
175
+ assertEquals (
176
+ 12.8 ,
177
+ wps .getDataForWay (wayWithFootSidePath ).walkSafety ().forward (),
178
+ epsilon
179
+ );
165
180
}
166
181
167
182
@ Test
You can’t perform that action at this time.
0 commit comments