Skip to content

Commit e5288a0

Browse files
author
Peter
committed
assume roads have sidewalks if not explicitely tagged, see discussion graphhopper#476
1 parent 178cce9 commit e5288a0

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

core/src/main/java/com/graphhopper/routing/util/FootFlagEncoder.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,9 @@ public FootFlagEncoder( int speedBits, double speedFactor )
113113
avoidHighwayTags.add("secondary_link");
114114
avoidHighwayTags.add("tertiary");
115115
avoidHighwayTags.add("tertiary_link");
116-
116+
117117
// for now no explicit avoiding #257
118118
//avoidHighwayTags.add("cycleway");
119-
120119
allowedHighwayTags.addAll(safeHighwayTags);
121120
allowedHighwayTags.addAll(avoidHighwayTags);
122121
allowedHighwayTags.add("cycleway");
@@ -367,9 +366,7 @@ void collect( OSMWay way, TreeMap<Double, Integer> weightToPrioMap )
367366
}
368367
} else if (maxSpeed > 50 || avoidHighwayTags.contains(highway))
369368
{
370-
if (way.hasTag("sidewalk", sidewalks))
371-
weightToPrioMap.put(45d, AVOID_IF_POSSIBLE.getValue());
372-
else if (way.hasTag("sidewalk", "no"))
369+
if (way.hasTag("sidewalk", "no"))
373370
weightToPrioMap.put(45d, WORST.getValue());
374371
else
375372
weightToPrioMap.put(45d, REACH_DEST.getValue());

core/src/test/java/com/graphhopper/routing/util/FootFlagEncoderTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ public void testPriority()
221221
way.clearTags();
222222
way.setTag("highway", "primary");
223223
way.setTag("sidewalk", "yes");
224-
assertEquals(PriorityCode.AVOID_IF_POSSIBLE.getValue(), footEncoder.handlePriority(way, 0));
224+
assertEquals(PriorityCode.REACH_DEST.getValue(), footEncoder.handlePriority(way, 0));
225225

226226
way.clearTags();
227227
way.setTag("highway", "cycleway");

0 commit comments

Comments
 (0)