我如何计算多角形(而不是多边形)的多角形的质心
我知道可以根据多边形来计算多边形的质心
from shapely.geometry import Polygon
coordinate_list = [[1,2], [2,3], [5,5]]
output = Polygon(coordinate_list).centroid
。 0],[0,1],[1,0]]]
有办法做到这一点。 Shapely似乎具有一个多角类,但与多边形类别的运行不相同。
I understand that the centroid of a polygon may be calculated from
from shapely.geometry import Polygon
coordinate_list = [[1,2], [2,3], [5,5]]
output = Polygon(coordinate_list).centroid
However, my coordinate_list is a multiple polygons, e.g. my coordinate_list = [[[1,2], [2,3], [5,5]], [[0,0], [0,1], [1,0]]]
Is there way to do this. Shapely appears to have a multipolygon class but it does not operate the same as the Polygon class.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
MultipolyGon()。centroid
,只是您不能将coordion_list
直接传递给多层构造函数:You can use
MultiPolygon().centroid
, it's just that you can't pass thatcoordinate_list
directly to MultiPolygon constructor as it: