Skip to content

Remove unconnected walking areas from graph - #4981

Merged
vesameskanen merged 1 commit into
opentripplanner:dev-2.xfrom
HSLdevcom:fix-unconnected-area-pruning
Mar 20, 2023
Merged

Remove unconnected walking areas from graph#4981
vesameskanen merged 1 commit into
opentripplanner:dev-2.xfrom
HSLdevcom:fix-unconnected-area-pruning

Conversation

@vesameskanen

@vesameskanen vesameskanen commented Mar 20, 2023

Copy link
Copy Markdown
Contributor

Summary

Walkable area builder is able to detect unconnected areas, but left them in the graph. Such areas often lack so called visibilityVertices, which are required when linking stops to areas. The result was that some isolated graph edges got linked with the stop, and island pruning did not discover to relink such stops after removal of the area.

It seems best to remove bad areas as soon as they get detected, instead of adding more complex code to deal with various linking problems. This PR does the required change.

Attached is a picture of a ferry platform, which got detached from the graph due to this bug.

image

…essing

This prevents stops from getting linked to graph parts to be removed later.
@vesameskanen
vesameskanen requested a review from a team as a code owner March 20, 2023 11:26
@vesameskanen vesameskanen added the !Bug Apply to issues describing a bug and PRs witch fixes it. label Mar 20, 2023
@codecov

codecov Bot commented Mar 20, 2023

Copy link
Copy Markdown

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (11d0094) 63.90% compared to head (b1ede04) 63.90%.

Additional details and impacted files
@@            Coverage Diff             @@
##             dev-2.x    #4981   +/-   ##
==========================================
  Coverage      63.90%   63.90%           
- Complexity     13501    13502    +1     
==========================================
  Files           1674     1674           
  Lines          66152    66156    +4     
  Branches        7155     7156    +1     
==========================================
+ Hits           42274    42277    +3     
- Misses         21492    21495    +3     
+ Partials        2386     2384    -2     
Impacted Files Coverage Δ
.../graph_builder/module/osm/WalkableAreaBuilder.java 81.19% <100.00%> (+0.21%) ⬆️

... and 3 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@leonardehrenfried

Copy link
Copy Markdown
Member

Under what circumstances does this happen? Is it an error in OSM or a bug of the walkable area code?

@vesameskanen

Copy link
Copy Markdown
Contributor Author

This usually happens in OsmBoardingLocation linking with a public transit platform. If the platform has simple shape like 4 point square (i.e. no convex points) and no entrance to platform area (unconnected area), the area gets no visibility vertices at all. In my opinion, that is not a bug but a correct result.

When trying to link a transit stop to this kind of area, absence of visibility points means that no connecting edges will be created. However, OsmBoardingLocation module adds some BoardingLocationToStopLink edges to the transit stop. Because of these links, island pruning thinks that stop is linked and does not relink it.

Instead of fixing such link errors, it seemed best to remove faulty areas.

@leonardehrenfried

Copy link
Copy Markdown
Member

And the best fix is to add an entry in OSM, isn't it?

@vesameskanen

Copy link
Copy Markdown
Contributor Author

Yes indeed. There will be an UnconnectedArea issue in the report, but this is the automated fix before data gets fixed.

@vesameskanen
vesameskanen merged commit a3f0103 into opentripplanner:dev-2.x Mar 20, 2023
@vesameskanen
vesameskanen deleted the fix-unconnected-area-pruning branch March 20, 2023 13:54
t2gran pushed a commit that referenced this pull request Mar 20, 2023
@t2gran t2gran added this to the 2.3 milestone Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

!Bug Apply to issues describing a bug and PRs witch fixes it.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants