Skip to content

Intersect MultiPolygon with Polygon (without dissolving faces) #898

Answered by dr-jts
micycle1 asked this question in Q&A
Discussion options

You must be logged in to vote

Actually that doesn't look like a valid MultiPolygon, since the faces are edge-adjacent. It should be represented as a GeometryCollection, or a an array or List of Polygons.

The usual process for doing this is called Polygon Coverage Overlay. JTS doesn't currently have a class that does this (although I hope to implement one medium-term). But it can be constructed by using noding and polygonization. There is a simple implementation here. If you want to keep only the resultants in the polygon B, you can use Point-In-Polygon tests to do that.

Performing overlay as a bulk process should be faster than performing a series of individual intersection operations, primarily due to the lower overh…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by dr-jts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants