python,安装方法:pip install fiona
#遍历shp面图层坐标点
import fiona
def getPolygonCoords():
with fiona.open(r'F:\...\测试.shp') as shapefile:
for feature in shapefile:
geometry = feature['geometry']
if geometry['type'] == 'Polygon':
# 遍历多边形的每个环
for ring in geometry['coordinates']:
print("开始一个新环")
for point in ring:
x,y = point[:2]
print(f"环的节点坐标: ({x}, {y})")
46

被折叠的 条评论
为什么被折叠?



