【问题标题】:how to load the kml file into google earth using python如何使用 python 将 kml 文件加载到谷歌地球
【发布时间】:2014-10-21 23:52:53
【问题描述】:

我正在我的 python 脚本中创建一个 kml 文件。 然后在 google earth 中手动打开。

python 中是否有在运行时将 kml 文件加载到 google earth 的命令。

【问题讨论】:

    标签: python-2.7 kml google-earth


    【解决方案1】:

    os.startfile("Path to the kml file") 或 webbrowser.open("Path to the kml file") 都将在 google earth 中加载 kml 文件。但是,这需要将 kml 文件默认设置为使用 google earth 打开。

    如果默认情况下 kml 文件未设置为使用 google earth 打开,os.system("Path to the GoogleEarth.exe 文件" + "path of the KML file") 将在 Google Earth 中打开它。还有其他方法可以完成此任务。

    This 链接为使用各自的应用程序打开文件提供了很好的解决方案。

    【讨论】:

    • 我尝试了 import os 然后 os.start file('path to kml') 并且成功了。谢谢!
    • 如果 KML 未设置为默认在 GE 中打开,您如何设置参数?
    • @Joe 非常抱歉回复晚了。如果您仍然需要解决方案,可以使用此命令 os.system("Path to the GoogleEarth.exe 文件" + "path of the KML file") 还有其他方法可以完成此任务。你可以看看这个stackoverflow.com/questions/15054434/…
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-02-12
    • 2011-03-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-06
    • 1970-01-01
    相关资源
    最近更新 更多