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 件)
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.
0 件のコメント
参考
カテゴリ
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!