-
Notifications
You must be signed in to change notification settings - Fork 99
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 CompoundGeometry
offset perimeter (dilation creates overlapping geometry)
#332
Conversation
@connorferster - seeing as you wrote the original code for this, wondering if you have time to have a quick look? |
- Offset now works with three or more equal-sized geometries stacked together (not just two) - Fixed error in test calculation: A = pi * r**2, not A = pi * r**2 / 4 - Tests pass but more work needs to be done on the algorithm to deal with re-entrant corners (later date).
@robbievanleeuwen For your review. The tests pass but mypy does not like my type annotations on one helper function. I am unsure of how to interpret the error messages in order to fix. The function takes input the looks like this: array([
<GEOMETRYCOLLECTION (MULTILINESTRING EMPTY, MULTILINESTRING ((500 500, 500 0)))>,
<GEOMETRYCOLLECTION (MULTILINESTRING EMPTY, MULTILINESTRING ((1000 0, 1000 5...>],
dtype=object
) I originally tried Any insight on what to be done to get this merged? |
Also, for fun: The live-stream for doing this PR: |
Thoroughly enjoyed the stream - helps with the code review as well 😆 Shapely is such a fun and feature rich library!
I've also added that test you were working on in the live stream with 3 rectangles! Thanks again for working on this one, bit of a curly one in the end! I also wouldn't lose too much sleep on all the edge cases as I'm sure there are many, and I've got a little note in the docs mentioning that the user should double check the output geometry in these cases! |
This PR addresses #331, in which dilated offsets create overlapping geometry.
Tasks:
test_compound_rectangular_offset()