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.
Polygon union and area
1 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Elementary Polygons 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!