Skip to content

[WIP] Tutorial to clip a feature collection#206

Draft
asinghvi17 wants to merge 3 commits intomainfrom
asinghvi17-patch-5
Draft

[WIP] Tutorial to clip a feature collection#206
asinghvi17 wants to merge 3 commits intomainfrom
asinghvi17-patch-5

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