
# 使用pykml库解析kml文件
from pykml import parser
#读取文件
root = parser.fromstring(open('源文件', 'r').read())
# 将读取的坐标点写入新文件中
with open('目标文件', 'w+') as f:
# 根据具体kml结构调整下面循环结构
for fol in root.Document.Folder.Placemark:
f.write(str(fol.Point.coordinates) + 'n')




近期评论