Question

I have a program where a 2D shape is represented by an R-trees. I want to be able to efficiently detect whether a shape is completely contained within another shape. Is this possible with R-tree?

Was it helpful?

Solution

R-trees work on bounding boxes. So for polygon-inside-polygon tests, it can serve as an efficient filtering step, but not answer the exact query. It produces candidates, and skips sure misses efficiently.

OTHER TIPS

if the shape is a child element, it means it is contained under parent element. if you have a problem with detecting a polygon inside another polygon, you can check this link.

Check if polygon is inside a polygon

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top