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

[WIP] Tutorial to clip a feature collection #206

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

asinghvi17
Copy link
Member

No description provided.

@asinghvi17
Copy link
Member Author

asinghvi17 commented Sep 26, 2024

The coverage code would be nice to create a clipping function with, maybe using extents as input. We can get away with losing a lot of exactness since it's not required (one of the polygons is guaranteed to have axis aligned edges, after all).

https://github.com/JuliaGeo/GeometryOps.jl/blob/main/src/methods/clipping/coverage.jl

A nice API would be intersection(polygon, rect) which could be called by intersection(multipolygon, rect). From there the core algorithm also generalizes to lines.

One issue is that holes will be cut the same as polygons. We should have a correction for this, which fixes polygons with holes for which one of the hole's edges is fully overlapped by one of the polygon's edges, and "dissolves"
the hole by cutting into the polygon. This will add time but create a more correct result. Winding order will have to be respected though.

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

Successfully merging this pull request may close these issues.

1 participant