Skip to content

Optimised intersection of geometry collections #1108

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

You must be logged in to vote

For a boolean AND of a set of polygons, the following pseudo-code is probably a good compromise between simplicity and performance:

result = geom[0[
for i = 1 to N {
  result = OverlayNG.intersection(result, geom[i]
  if result.isEmpty
    break
}

Note that OverlayNG has optimizations for intersection, so it's best to use it,.

I'm curious to know what your use case is?

Replies: 4 comments 6 replies

Comment options

You must be logged in to vote
1 reply
@micycle1
Comment options

Comment options

You must be logged in to vote
1 reply
@micycle1
Comment options

Comment options

You must be logged in to vote
1 reply
@micycle1
Comment options

Answer selected by dr-jts
Comment options

You must be logged in to vote
3 replies
@micycle1
Comment options

@dr-jts
Comment options

@micycle1
Comment options

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