Polygon union and area

1 次查看(过去 30 天)
TJ
TJ 2012-4-25
I have a set of simple polygons that are randomly distributed over a given region. Basically what I want to do is to find the total area covered by a subset of them. Currently, I am using a combination of 'polybool' and 'polyarea' to accomplish this.
The problem is that I have to do this a number of times with different subsets of the polygons. Are there any other functions or tricks I could use to improve the runtime?
For the most part I am just adding a polygon to an existing set. I store the union of the polygons between iterations so I do not need to calculate the entire union every time. However, I also have to perform "subtract" operations. If I was to just remove polygon A from union(A,B,C) then that would not be correct since there might be regions of A that B and C cover. So I am forced to recalculate the entire union again. Would there be a more efficient way to do this?
Thank you.

回答(1 个)

Walter Roberson
Walter Roberson 2012-4-25
Divide the area into sections, and for each section store the list of polygons that are partly or fully inside the section. When a particular polygon is removed, you only need to recalculate the union for the sections that the removed polygon touched.

类别

Help CenterFile Exchange 中查找有关 Elementary Polygons 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by