Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/287.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何将形状多边形转换为多边形_Python_Polygon_Shapely - Fatal编程技术网

Python 如何将形状多边形转换为多边形

Python 如何将形状多边形转换为多边形,python,polygon,shapely,Python,Polygon,Shapely,我有多面多边形,我怎么能把它转换成多边形列表呢 polygons = [Polygon(cham_geom), Polygon(neighbor_geom)] boundary = cascaded_union(polygons) # results in multipolygon sometimes if boundary.geom_type == 'MultiPolygon': # extract polygons out of multipolygon MultiPoly

我有多面多边形,我怎么能把它转换成多边形列表呢

polygons = [Polygon(cham_geom), Polygon(neighbor_geom)]
boundary = cascaded_union(polygons)  # results in multipolygon sometimes
if boundary.geom_type == 'MultiPolygon':
       # extract polygons out of multipolygon

MultiPolygon可以通过
geoms
属性进行编辑,因此您可以在MultiPolygon中对多边形执行循环操作

polygons = [Polygon(cham_geom), Polygon(neighbor_geom)]
boundary = cascaded_union(polygons)  # results in multipolygon sometimes
if boundary.geom_type == 'MultiPolygon':
   # extract polygons out of multipolygon
   list = []
   for polygon in boundary.geoms:
       list.append(polygon)