Remove banDiscouragedCycling and banDiscouragedWalking#5341
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #5341 +/- ##
=============================================
+ Coverage 66.35% 66.38% +0.02%
- Complexity 15182 15187 +5
=============================================
Files 1787 1787
Lines 69263 69241 -22
Branches 7339 7337 -2
=============================================
+ Hits 45957 45963 +6
+ Misses 20825 20796 -29
- Partials 2481 2482 +1
☔ View full report in Codecov by Sentry. |
| void footDiscouraged() { | ||
| var regular = WayTestData.pedestrianTunnel(); | ||
| var props = wps.getDataForWay(regular); | ||
| assertEquals(PEDESTRIAN_AND_BICYCLE, props.getPermission()); |
There was a problem hiding this comment.
It is a bit surprising that highway=footway gets BICYCLE permission by default, even when bicycle=no is set. Anyway, that issue is out of the scope of this PR.
There was a problem hiding this comment.
Where do you see bicycle=no?
However, highway=footway should probably not allow bicycles: https://wiki.openstreetmap.org/wiki/Tag:highway=footway?uselang=en
We should indeed change it in a separate PR.
There was a problem hiding this comment.
I tested adding bicycle=no myself, just for curiosity :) It did not change anything.
There was a problem hiding this comment.
I believe that it's this piece of code taking care of it:
I would be in favour of moving that somehow together with the other code figuring out the permissions.
There was a problem hiding this comment.
I started working on that, and also fixing some known errors in traversal permission processing.
| public void addTag(String key, String value) { | ||
| if (key == null || value == null) return; | ||
| public OSMWithTags addTag(String key, String value) { | ||
| if (key == null || value == null) return this; |
There was a problem hiding this comment.
Can you split the return to its own line or at least wrap it with {}
| public OSMWithTags addTag(String key, String value) { | ||
| if (key == null || value == null) return this; | ||
|
|
||
| if (tags == null) tags = new HashMap<>(); |
| props.setMixinProperties("foot=discouraged", ofWalkSafety(3)); | ||
| props.setMixinProperties("bicycle=discouraged", ofBicycleSafety(3)); |
There was a problem hiding this comment.
I checked that this wasn't handled in the NorwayMapper either and it doesn't rely on the default mapper. I can ask if the norwegians have interest in this too.
There was a problem hiding this comment.
Sure, you can ask but I see very, very few instances of this tag in the Nordics: https://taginfo.openstreetmap.org/tags/bicycle=discouraged#map
optionsome
left a comment
There was a problem hiding this comment.
I asked Entur if they needed this change in norway mapper as well but since the tagging is rarely ever used it's not needed.
Summary
This PR removes the configuration options
banDiscouragedWalkingandbanDiscouragedCyclingand replaces them with safety factors in theDefaultMapper.This is more to the spirit of the tag which means that these ways are avoided if possible.
Unit tests
Added.
Documentation
Automatically generated.