Repository navigation
Apply correct traversal permissions to barrier vertex - #5369
Conversation
Osm contains nodes tagged as access=no and which represent an end point of a way. For example, a doorway leading to a locked gate is sometimes modeled like that. If routing request snaps to such end point, routing fails. Barrier end vertices do not add any kind of useful functionality but just cause trouble.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #5369 +/- ##
=============================================
+ Coverage 66.50% 66.53% +0.02%
- Complexity 15235 15255 +20
=============================================
Files 1785 1787 +2
Lines 69271 69303 +32
Branches 7291 7301 +10
=============================================
+ Hits 46069 46110 +41
+ Misses 20733 20719 -14
- Partials 2469 2474 +5
☔ View full report in Codecov by Sentry. |
leonardehrenfried
left a comment
There was a problem hiding this comment.
One small thing, otherwise this looks good.
|
|
||
| /** | ||
| * Checks if this node is bollard | ||
| static final Set<String> motorVehicleBarriers = Set.of("bollard", "bar", "chain"); |
There was a problem hiding this comment.
I think static variables belong to the top of the class and should be named like MOTOR_VEHICLE_BARRIERS
| public boolean isBollard() { | ||
| return isTag("barrier", "bollard"); | ||
| public boolean isMotorVehicleBarrier() { | ||
| var barrier = this.getTag("barrier"); |
There was a problem hiding this comment.
It's too late now because I don't want to hold up the merge of this PR but whenever we touch this code again, there is the following new helper method for checking if it's one of a set of tag values:
There was a problem hiding this comment.
Oh yes, I forgot that new method. Let's fix this in some upcoming OSM related PR.
Summary
Two bug fixes in barrier vertex:
Issue
Closes #5353
Unit tests
Tests updated to reflect correct barrier permissions. One new unit test which tests barrier pruning added.
Documentation
Javadoc updated