Skip to content
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

feat: Polygon operations #1198

Merged
merged 7 commits into from
May 26, 2022
Merged

feat: Polygon operations #1198

merged 7 commits into from
May 26, 2022

Conversation

manthey
Copy link
Contributor

@manthey manthey commented May 6, 2022

This adds some polygon operation utilities. The utilities are in geo.util.polyops and are union, difference, intersect, and xor. Basic usage is union(poly1, poly2, opts), where the polygons can be in a variety of formats including taken from a polygon feature. The options allow a variety of control. Internally, we use the polybool library, which (with the right branch) has proven to be reliable in the past.

This shows intersection two polygon features, one shown in blue and one in red, with the output in green:
Animation

@manthey
Copy link
Contributor Author

manthey commented May 6, 2022

The next step is to add support for annotation layers. This is a necessary antecedent to supporting more complex annotation editing options, such as paint brush and wand tools, and, in general behaving in expected manners with polygons with holes.

@manthey manthey marked this pull request as draft May 6, 2022 14:53
@manthey manthey force-pushed the polygon-operations branch from 2a326db to e2821f6 Compare May 9, 2022 14:38
@manthey manthey force-pushed the polygon-operations branch 7 times, most recently from cf0a3ed to f3bf949 Compare May 20, 2022 20:42
@manthey manthey marked this pull request as ready for review May 20, 2022 21:07
@manthey
Copy link
Contributor Author

manthey commented May 23, 2022

Closes #845.

@manthey manthey force-pushed the polygon-operations branch from f3bf949 to 885eac3 Compare May 23, 2022 18:34
@manthey manthey force-pushed the polygon-operations branch from 885eac3 to d27d201 Compare May 24, 2022 16:53
@manthey manthey merged commit ffc7f42 into master May 26, 2022
@manthey manthey deleted the polygon-operations branch May 26, 2022 16:28
@github-actions
Copy link

🎉 This PR is included in version 1.9.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant