-
Notifications
You must be signed in to change notification settings - Fork 10
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
Create nodes at lines intersections #51
Create nodes at lines intersections #51
Conversation
A node is created at the intersection and the corresponding edges are split accordingly. Issue: tomalrussel/snkit#15 NB: the file `pyproject.toml` has beend added for testing with local dev files.
Tests for: - multiple intersections - partially overlapping lines - end-node intersection - already split network NOTE: overlapping lines test doesn't pass! Issue: tomalrussel/snkit#15
There is now a recursive function extracting the points from intersections, in an exhaustive way (excluding polygons). The crossing restriction has been removed because it is wrong for overlapping segments: the corresponding test now passes. A notable consequence is the change in handling endpoints: intersections with endpoints are now accepted. Issue: tomalrussel/snkit#15
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good intersection_endpoints
logic helps make things clearer. I'll reply about self-intersection separately.
Special treatment of complex lines: - self-intersection points need to be found, no built-in way to do so - splitting a complex line at a self-intersecting point doesn't do what would be expected: a work around when splitting as well. NB: small fixes from @tomalrussel have been implemented
How do you usually handle the conflicts: should I rebase or merge my branch? Or you don't really care? |
Either is fine, thanks @jmon12! |
intersection = [ | ||
Point(p) for p, c in Counter(segments_coordinates).items() if c > 1 | ||
] | ||
intersection = MultiPoint(intersection) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might have sense to have a dedicated helper function here...
… main Merging #51 and dealing with conflicts.
Hi @jmon12 - apologies for leaving this hanging for a while - I've just fixed the conflicts and merged this in. I think it's in really useful shape, thanks for your work |
Hi @tomalrussell, I'm the one to be sorry! I was supposed to resolve the conflicts but was working on something else. Thank you! |
A node is created at the edges intersections and the corresponding edges are split accordingly.
This is an attempt to fix #15