سؤال

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?

هل كانت مفيدة؟

المحلول

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.

نصائح أخرى

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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top