简体   繁体   中英

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). It is clear that L3 would belong to R1. How about L1, L2 and P1? I thought about creating bounding boxes around them and check if the South-East coordinate( minX and minY) belongs to R1. In this way L1 would belong to R2, even though it doesn't even crosses 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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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