简体   繁体   English

如何将多边形分割/划分为现有区域?

[英]How to separate/partition polygons into existing regions?

I'm facing a problem regarding "partitioning"/subsetting polygons into regions (bigger polygons) so that each region should have disjoint meaningful elements. 我面临有关将多边形“划分” /子集到区域(较大的多边形)的问题,以便每个区域都应具有不相交的有意义的元素。

在此处输入图片说明
For example, we have the following regions/polygons. 例如,我们有以下区域/多边形。 At a given time, we know only the form of one region (let's say R1 for now). 在给定的时间,我们只知道一个区域的形式(现在让我们说R1)。 It is clear that L3 would belong to R1. 显然,L3属于R1。 How about L1, L2 and P1? L1,L2和P1怎么样? I thought about creating bounding boxes around them and check if the South-East coordinate( minX and minY) belongs to R1. 我考虑过要在它们周围创建边界框,并检查东南坐标(minX和minY)是否属于R1。 In this way L1 would belong to R2, even though it doesn't even crosses R2. 这样,即使L1甚至不穿越R2,它也属于R2。

Do you have any concrete idea what I should look into for these sort of algorithms or how to solve this space separation problem? 您有什么具体的想法,我应该针对这些算法进行研究,或者如何解决这种空间分离问题​​?

If your regions and polygons are all described as polygons (discrete sequences of vertices), you can resort to the available polygon clipping techniques. 如果您的区域和多边形都被描述为多边形(离散的顶点序列),则可以求助于可用的多边形裁剪技术。

In particular, have a look at the Sutherland–Hodgman and Weiler–Atherton techniques. 特别要看一下Sutherland-HodgmanWeiler-Atherton的技术。

Some optimization is possible if preprocessing of the windows is allowed (when there are many subject polygons for the same windows), using scanline techniques. 如果允许使用扫描线技术对窗口进行预处理(当同一窗口有多个主题多边形时),则可以进行一些优化。 This is a little more sophisticated. 这有点复杂。

The case of line segment entities is a little easier. 线段实体的情况要容易一些。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM