从Shapely中的多边形中提取点/坐标

ryanjdillon:

如何获取/提取定义shapely多边形的点谢谢!

形状多边形的示例

from shapely.geometry import Polygon

# Create polygon from lists of points
x = [list of x vals]
y = [list of y vals]

polygon = Polygon(x,y)
ryanjdillon:

因此,我发现窍门是使用Polygon类方法的组合来实现。

如果你想测地坐标,然后需要转换(通过这些回WGS84 pyprojmatplotlibbasemap,或东西)。

from shapely.geometry import Polygon

#Create polygon from lists of points
x = [list of x vals]
y = [list of y vals]

some_poly = Polygon(x,y)

# Extract the point values that define the perimeter of the polygon
x, y = some_poly.exterior.coords.xy

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章