如何获取/提取定义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)
因此,我发现窍门是使用Polygon
类方法的组合来实现。
如果你想测地坐标,然后需要转换(通过这些回WGS84 pyproj
,matplotlib
的basemap
,或东西)。
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] 删除。
我来说两句