How to detect if a 2-D shape contains another shape with R-tree?
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?
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.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow