Python 几何体的凸包

Python 几何体的凸包,python,shapely,Python,Shapely,我需要得到一个多边形的凸包。我在用shapely。不确定如何应用凸包以获得所需的结果: from shapely.geometry import Polygon p = Polygon(((0,0),(2,0),(2,2),(0,2),(1,1))) 我需要的结果。我不知道如何获得坐标,包括重复第一步: In[]: p.convex_hull # How to get the resulted coordinates? Out[]: ((0,0),(2,0),(2,2),(0,2),(0,

我需要得到一个多边形的凸包。我在用shapely。不确定如何应用凸包以获得所需的结果:

from shapely.geometry import Polygon
p = Polygon(((0,0),(2,0),(2,2),(0,2),(1,1)))
我需要的结果。我不知道如何获得坐标,包括重复第一步:

In[]: p.convex_hull   # How to get the resulted coordinates?
Out[]:
((0,0),(2,0),(2,2),(0,2),(0,0)
试试这个:

from shapely.geometry import Polygon
p = Polygon(((0,0),(2,0),(2,2),(0,2),(1,1)))
x = p.convex_hull
a, b = x.exterior.coords.xy
tuple(list(zip(a,b)))

谢谢,使用您的想法,我用tuple(list(zip(a,b)))替换了您的迭代