Skip to content

Commit

Permalink
De-prioritize ways tagged with foot=use_sidepath
Browse files Browse the repository at this point in the history
  • Loading branch information
ratrun committed Jul 6, 2024
1 parent 6b1995c commit ce1235a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ void collect(ReaderWay way, TreeMap<Double, PriorityCode> weightToPrioMap) {
if (way.hasTag("foot", "designated"))
weightToPrioMap.put(100d, PREFER);

if (way.hasTag("foot", "use_sidepath")) {
weightToPrioMap.put(100d, VERY_BAD);
}

double maxSpeed = Math.max(getMaxSpeed(way, false), getMaxSpeed(way, true));
if (safeHighwayTags.contains(highway) || (isValidSpeed(maxSpeed) && maxSpeed <= 20)) {
weightToPrioMap.put(40d, PREFER);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,11 @@ public void testPriority() {
way.clearTags();
way.setTag("highway", "tertiary");
assertEquals(PriorityCode.UNCHANGED.getValue(), prioParser.handlePriority(way, null));
way.setTag("foot","use_sidepath");
assertEquals(PriorityCode.VERY_BAD.getValue(), prioParser.handlePriority(way, null));

way.clearTags();
way.setTag("highway", "tertiary");
// tertiary without sidewalk is roughly like primary with sidewalk
way.setTag("sidewalk", "no");
assertEquals(PriorityCode.AVOID.getValue(), prioParser.handlePriority(way, null));
Expand Down

0 comments on commit ce1235a

Please sign in to comment.