开发者

How do you send KML to Google-Earth running locally?

开发者 https://www.devze.com 2023-02-22 11:22 出处:网络
(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 m

(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开发者_JAVA技巧 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?


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.


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消