如何将 KML 发送到本地运行的 Google-Earth?

发布于 2024-10-30 17:01:42 字数 328 浏览 7 评论 0原文

(背景:我了解什么是 KML。我可以手动创建自己的 KML(例如使用文本编辑器)或编辑 KML 示例以用于我自己的目的。我找到了一个名为 JAK 的库来为我生成 KML。所以我知道如何创建我需要的 KML 对象,

但我似乎找不到任何有关如何在本地运行时将 KML 对象推送到 Google-Earth 的信息。谷歌地球在浏览器中运行。)


我有一个java应用程序,每x秒生成一个KML对象。当生成 KML 对象时,我需要将每个 KML 对象推送到 Google-Earth 上。 如何使用 Java 将 KML 对象推送到本地运行的 Google-Earth 上?

(Background: I understand what is KML. I am able to manually create my own KML (using like a text editor for example) or edit a KML example for my own purposes. I found a library to generate KML for me called JAK. So I know how to create the KML object's that I need.

I searched online and I can't seem to find anything about how you can push your KML object onto Google-Earth while it is running locally. Most of the info online is talking about google earth running in a browser.)


I have a java app that generates a KML object every x seconds. I need to push each of these the KML objects onto Google-Earth as the KML objects are generated. Using Java how do I push KML objects onto Google-Earth running locally?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

一袭水袖舞倾城 2024-11-06 17:01:42

生成带有 NetworkLink 的 KML 文件,并让该 NetworkLink 每 X 秒刷新一次。这将允许 GE 中的自动刷新。

然后,让您的流程定期在适当的位置生成新的 KML。

Generate a KML with a NetworkLink to your file, and have that NetworkLink refresh every X seconds. This will allow for auto-refresh in GE.

Then, just have your process generate new KML at the appropriate place on a regular schedule.

尴尬癌患者 2024-11-06 17:01:42

您可以先将 KML 对象保存为临时 KML 文件,然后使用 KML 文件作为参数启动 Google 地球:-

Runtime.getRuntime().exec(new String[] {
        "C:/Program Files/Google/Google Earth/googleearth.exe",
        "C:/myfiles/Test.kml"
});

我测试了它,它对我有用。

You could save the KML object as a temporary KML file first, then launch Google Earth with the KML file as a parameter:-

Runtime.getRuntime().exec(new String[] {
        "C:/Program Files/Google/Google Earth/googleearth.exe",
        "C:/myfiles/Test.kml"
});

I tested it and it works for me.

み零 2024-11-06 17:01:42

查看 Chris Stayte 的代码,网址为 https://github.com/ChrisStayte/ArcMap_To_Google_Earth

他做了什么JonnyO 建议但在 C# 中并在与 ArcMap 同步的上下文中

Have a look at Chris Stayte's code at https://github.com/ChrisStayte/ArcMap_To_Google_Earth

He does what JonnyO suggests but in C# and in the context of synchronizing with ArcMap

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文