Replies: 4 comments 4 replies
-
The closest is the functions for polygon overlay in PolygonOverlayFunctions At some point the hope is to provide this as a supported API. Note that this computes the full "flattened" overlay of a set of overlapping polygons, which is doing more than the pairwise intersections in your code. |
Beta Was this translation helpful? Give feedback.
-
Before we discuss this further, you'd better confirm what semantics you are looking for. I can think of at least 3 different semantics for "the intersection of many geometries". Can you provide a diagram or example of explanatory case(s)? |
Beta Was this translation helpful? Give feedback.
-
For a boolean AND of a set of polygons, the following pseudo-code is probably a good compromise between simplicity and performance:
Note that OverlayNG has optimizations for intersection, so it's best to use it,. I'm curious to know what your use case is? |
Beta Was this translation helpful? Give feedback.
-
For that use case it might be faster to use the But this is a lot more code, of course. |
Beta Was this translation helpful? Give feedback.
-
Just to check, is there anything like
UnaryUnionOp.union()
for the intersection of many geometries?Anything that's likely better than
geoms.parallelStream().reduce((g1, g2) -> g1.intersection(g2))
?Beta Was this translation helpful? Give feedback.
All reactions