Efficient extraction of all sub-polygons generated by self-intersecting features in a MultiPolygon

后端 未结 3 1822
孤街浪徒
孤街浪徒 2021-02-03 23:05

Starting from a shapefile containing a fairly large number (about 20000) of potentially partially-overlapping polygons, I\'d need to extract all the sub-polygons originated by i

3条回答
  •  一整个雨季
    2021-02-03 23:55

    Not sure if it helps you since it is not in R but I think there is a good way to solve this problem using Python. There is a library called GeoPandas (http://geopandas.org/index.html) which has allows you to easily do geo operations. In steps what you would need to do is the following:

    1. Load all Polygons into geopandas GeoDataFrames
    2. Loop all GeoDataFrames running a union overlay operation (http://geopandas.org/set_operations.html)

    The exact example is shown in the documentation.

    Before operation - 2 Polygons

    After operation - 9 Polygons

    If there is anything unclear feel free to let me know! Hope it helps!

提交回复
热议问题