Apply turn restrictions to split edges#3414
Conversation
d0ac4fa to
4060228
Compare
|
@gmellemstrand If you'd like to review this, I'd be very happy. |
gmellemstrand
left a comment
There was a problem hiding this comment.
This looks good from a functionality standpoint. It is also good that you have added tests using minimal OSM test data sets.
What I would like is to have a single place where attributes from StreetEdges (and their vertices) are propagated down to the split edges. There is code at the bottom of the StreetEdge splitDestructively and splitNonDestructively methods that apply some of these parameters. I think those could be replaced with a method call that also applies the turn restrictions.
That way we could keep the VertexLinker a bit simpler, and it will not have to concern itself with the details of how the StreetEdge is implemented.
|
@gmellemstrand Thanks for the review. I've moved the code into the StreetEdge class. Since adding and removing turn restrictions requires a Graph instance, the code isn't quite as self-contained as I'd hoped. You still have to pass a graph in. |
|
It is unfortunate that you have to pass in the graph instance, but changing this is a bigger refactor, that I think is outside the scope of this PR. It is a problem with the model in general that you have to pass in the graph in many places. Ideally the StreetEdge should point to its own turn restrictions. I have not checked the turn restriction code in detail, but since it is relatively self-contained and tested, I will approve this PR. Feel free to merge. |
|
Thanks! I don't have merge permissions so @t2gran has to take care of it. |
Summary
So far turn restrictions were not applied correctly to edges split due to being close to a transit stop. This PR fixes it.
Issue
Fixes #2965
Fixes #3402
Unit tests
I've created two tests that take real cases from the Stuttgart, Germany area and do routing on a tiny graph.
Code style
✅
Documentation
n/a
Changelog