@@ -62,42 +62,63 @@ public void populateProperties(WayPropertySet props) {
6262 props .setProperties ("mtb:scale=4" , noneWayProperties );
6363 props .setProperties ("mtb:scale=5" , noneWayProperties );
6464 props .setProperties ("mtb:scale=6" , noneWayProperties );
65- props .setProperties ("highway=bridleway" , withModes (NONE ).bicycleSafety (1.3 ));
65+ props .setProperties ("highway=bridleway" , withModes (NONE ).walkSafety ( 1.3 ). bicycleSafety (1.3 ));
6666
6767 /* PEDESTRIAN */
68- props .setProperties ("highway=corridor" , withModes (PEDESTRIAN ));
68+ props .setProperties ("highway=corridor" , withModes (PEDESTRIAN ). walkSafety ( 0.9 ) );
6969 props .setProperties ("highway=steps" , withModes (PEDESTRIAN ));
70- props .setProperties ("highway=crossing" , withModes (PEDESTRIAN ));
70+ props .setProperties ("highway=crossing" , withModes (PEDESTRIAN ). walkSafety ( 0.9 ) );
7171 props .setProperties ("highway=platform" , withModes (PEDESTRIAN ));
7272 props .setProperties ("public_transport=platform" , withModes (PEDESTRIAN ));
7373 props .setProperties ("railway=platform" , withModes (PEDESTRIAN ));
74- props .setProperties ("highway=pedestrian" , withModes (PEDESTRIAN ).bicycleSafety (0.9 ));
75- props .setProperties ("highway=footway" , withModes (PEDESTRIAN ).bicycleSafety (1.1 ));
76- props .setProperties ("mtb:scale=1" , withModes (PEDESTRIAN ).bicycleSafety (1.5 ));
77- props .setProperties ("mtb:scale=2" , withModes (PEDESTRIAN ).bicycleSafety (3.0 ));
74+ props .setProperties (
75+ "highway=pedestrian" ,
76+ withModes (PEDESTRIAN ).walkSafety (0.8 ).bicycleSafety (0.9 )
77+ );
78+ props .setProperties (
79+ "highway=footway" ,
80+ withModes (PEDESTRIAN ).walkSafety (0.8 ).bicycleSafety (1.1 )
81+ );
82+ props .setProperties ("mtb:scale=1" , withModes (PEDESTRIAN ).walkSafety (1.5 ).bicycleSafety (1.5 ));
83+ props .setProperties ("mtb:scale=2" , withModes (PEDESTRIAN ).walkSafety (3.0 ).bicycleSafety (3.0 ));
7884
7985 /* BICYCLE */
80- props .setProperties ("highway=cycleway" , withModes (BICYCLE ).bicycleSafety (0.6 ));
86+ props .setProperties ("highway=cycleway" , withModes (BICYCLE ).walkSafety ( 2.0 ). bicycleSafety (0.6 ));
8187
8288 /* PEDESTRIAN_AND_BICYCLE */
8389 props .setProperties ("mtb:scale=0" , withModes (PEDESTRIAN_AND_BICYCLE ));
84- props .setProperties ("highway=path" , withModes (PEDESTRIAN_AND_BICYCLE ).bicycleSafety (0.75 ));
90+ props .setProperties (
91+ "highway=path" ,
92+ withModes (PEDESTRIAN_AND_BICYCLE ).walkSafety (0.85 ).bicycleSafety (0.75 )
93+ );
8594
8695 /* ALL */
87- props .setProperties ("highway=living_street" , withModes (ALL ).bicycleSafety (0.9 ));
96+ props .setProperties (
97+ "highway=living_street" ,
98+ withModes (ALL ).walkSafety (0.95 ).bicycleSafety (0.9 )
99+ );
88100 props .setProperties ("highway=unclassified" , allWayProperties );
89101 props .setProperties ("highway=road" , allWayProperties );
90- props .setProperties ("highway=byway" , withModes (ALL ).bicycleSafety (1.3 ));
91- props .setProperties ("highway=track" , withModes (ALL ).bicycleSafety (1.3 ));
92- props .setProperties ("highway=service" , withModes (ALL ).bicycleSafety (1.1 ));
93- props .setProperties ("highway=residential" , withModes (ALL ).bicycleSafety (0.98 ));
94- props .setProperties ("highway=residential_link" , withModes (ALL ).bicycleSafety (0.98 ));
102+ props .setProperties ("highway=byway" , withModes (ALL ).walkSafety (1.3 ).bicycleSafety (1.3 ));
103+ props .setProperties ("highway=track" , withModes (ALL ).walkSafety (1.3 ).bicycleSafety (1.3 ));
104+ props .setProperties ("highway=service" , withModes (ALL ).walkSafety (1.1 ).bicycleSafety (1.1 ));
105+ props .setProperties ("highway=residential" , withModes (ALL ).walkSafety (0.98 ).bicycleSafety (0.98 ));
106+ props .setProperties (
107+ "highway=residential_link" ,
108+ withModes (ALL ).walkSafety (0.98 ).bicycleSafety (0.98 )
109+ );
95110 props .setProperties ("highway=tertiary" , allWayProperties );
96111 props .setProperties ("highway=tertiary_link" , allWayProperties );
97- props .setProperties ("highway=secondary" , withModes (ALL ).bicycleSafety (1.5 ));
98- props .setProperties ("highway=secondary_link" , withModes (ALL ).bicycleSafety (1.5 ));
99- props .setProperties ("highway=primary" , withModes (ALL ).bicycleSafety (2.06 ));
100- props .setProperties ("highway=primary_link" , withModes (ALL ).bicycleSafety (2.06 ));
112+ props .setProperties ("highway=secondary" , withModes (ALL ).walkSafety (1.5 ).bicycleSafety (1.5 ));
113+ props .setProperties (
114+ "highway=secondary_link" ,
115+ withModes (ALL ).walkSafety (1.5 ).bicycleSafety (1.5 )
116+ );
117+ props .setProperties ("highway=primary" , withModes (ALL ).walkSafety (2.06 ).bicycleSafety (2.06 ));
118+ props .setProperties (
119+ "highway=primary_link" ,
120+ withModes (ALL ).walkSafety (2.06 ).bicycleSafety (2.06 )
121+ );
101122 props .setProperties ("highway=trunk" , withModes (ALL ).walkSafety (7.47 ).bicycleSafety (7.47 ));
102123 props .setProperties ("highway=trunk_link" , withModes (ALL ).walkSafety (7.47 ).bicycleSafety (2.06 ));
103124
@@ -185,6 +206,17 @@ public void populateProperties(WayPropertySet props) {
185206 )
186207 );
187208
209+ /* foot=designated */
210+ props .setMixinProperties (
211+ new ExactMatchSpecifier (
212+ new Equals ("foot" , "designated" ),
213+ new Not (new Equals ("highway" , "footway" )),
214+ new Not (new Equals ("highway" , "pedestrian" )),
215+ new Not (new Equals ("highway" , "path" ))
216+ ),
217+ ofWalkSafety (0.9 )
218+ );
219+
188220 /* sidewalk and crosswalk */
189221 props .setMixinProperties ("footway=sidewalk" , ofBicycleSafety (2.5 ));
190222 props .setMixinProperties ("footway=crossing" , ofBicycleSafety (2.5 ));
@@ -221,6 +253,51 @@ public void populateProperties(WayPropertySet props) {
221253 ofBicycleSafety (0.7 )
222254 );
223255
256+ // prefer walking on sidewalks
257+ props .setMixinProperties (
258+ new LogicalOrSpecifier (
259+ new ExactMatchSpecifier (
260+ new Equals ("sidewalk" , "yes" ),
261+ new Not (new Condition .OneOf ("highway" , "footway" , "pedestrian" , "path" , "trunk" ))
262+ ),
263+ new ExactMatchSpecifier (
264+ new Equals ("sidewalk" , "left" ),
265+ new Not (new Condition .OneOf ("highway" , "footway" , "pedestrian" , "path" , "trunk" ))
266+ ),
267+ new ExactMatchSpecifier (
268+ new Equals ("sidewalk" , "right" ),
269+ new Not (new Condition .OneOf ("highway" , "footway" , "pedestrian" , "path" , "trunk" ))
270+ ),
271+ new ExactMatchSpecifier (
272+ new Equals ("sidewalk" , "both" ),
273+ new Not (new Condition .OneOf ("highway" , "footway" , "pedestrian" , "path" , "trunk" ))
274+ )
275+ ),
276+ ofWalkSafety (0.9 )
277+ );
278+
279+ props .setMixinProperties (
280+ new LogicalOrSpecifier (
281+ "highway=trunk;sidewalk=yes" ,
282+ "highway=trunk;sidewalk=left" ,
283+ "highway=trunk;sidewalk=right" ,
284+ "highway=trunk;sidewalk=both" ,
285+ "highway=trunk_link;sidewalk=yes" ,
286+ "highway=trunk_link;sidewalk=left" ,
287+ "highway=trunk_link;sidewalk=right" ,
288+ "highway=trunk_link;sidewalk=both"
289+ ),
290+ ofWalkSafety (0.4 )
291+ );
292+
293+ props .setMixinProperties (
294+ new ExactMatchSpecifier (
295+ new Equals ("sidewalk" , "lane" ),
296+ new Not (new Condition .OneOf ("highway" , "footway" , "pedestrian" , "path" ))
297+ ),
298+ ofWalkSafety (0.95 )
299+ );
300+
224301 /*
225302 * Automobile speeds in the United States: Based on my (mattwigway) personal experience, primarily in California
226303 */
0 commit comments