-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix almost junction behaviour for close endpoints #7309
Conversation
I think I could optimise this by running the nearby endpoint detection and angle checks in the quick fix code rather than in the validation itself. Will try to adapt as such 👍 |
Ready for review now, due to all indentation changes in
|
ddbe3c1
to
210d4aa
Compare
Based on distances at which nodes are joined by the quickfix and the validation extends ahead of an end node, if both ways have close end nodes and joining them would result in a small change of angle for the edited way then they will be joined. Closes #7201
Just a bit more optimised since this is only relevant to check when the quick fix is used
Realised these are used for highlighting and should remain as is.
210d4aa
to
64ae360
Compare
@SilentSpike Thanks so much!! I didn't trace every line of code but it appears to work as expected. Plus the code tests are a big reassurance. Just merged it as-is but we can make changes on the main branch if needed. |
Closes #7201
Basically, if an intersection is found, it now checks:
EXTEND_DIST - NODE_JOIN_DIST
of the node being extended fromatan(NODE_JOIN_DIST / EXTEND_DIST)
These thresholds were arrived at by considering the edge-most cases where we'd want endpoint joining to kick in:
(the distance threshold, we want to catch an effectively parallel way that would be joined just outside of the existing node joining distance)
(the angle threshold, a perpendicular way would already be joined to the end node if the intersection occurs at the joining distance, so we want to catch cases where the change in edge angle is less than the angle of this triangle)
Some before/after applying the quick fix for different test cases:
(this one is both endpoints of the same way)
(both close, connects to end which creates smallest change in angle)