Trevor Boyd Smith
Trevor Boyd Smith

Reputation: 19223

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

(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?

Upvotes: 2

Views: 4069

Answers (3)

TazAstroSpacial
TazAstroSpacial

Reputation: 131

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

Upvotes: 0

JohnnyO
JohnnyO

Reputation: 3068

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.

Upvotes: 2

limc
limc

Reputation: 40160

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.

Upvotes: 0

Related Questions