We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpIntegration › controlling GoogleEarth via applescript
Page Index Toggle Pages: 1
controlling GoogleEarth via applescript (Read 1354 times)
controlling GoogleEarth via applescript
Feb 7th, 2007, 12:02pm
 
the latest version of GoogleEarth now has an applescript interface. so it’s possible to control the camera from outside. with apple’s cocoa libs it is even possible to call the applescript from within Processing.

Code:

import com.apple.cocoa.foundation.*;

float latitude = 48.169729;
float longitude = 11.553175;
float distance = 150;
float tilt = 0;
float azimuth = 0;

void setup()
{
size(360, 90);

}

void draw()
{
setViewInfo(latitude, longitude, distance, mouseY, mouseX);
}

void setViewInfo(float latitude, float longitude, float distance, float tilt, float azimuth)
{
String script = "tell application \"Google Earth\"\n"

+ "SetViewInfo { latitude:"+latitude+", longitude:+"+longitude+", distance:+"+distance+", tilt:"+tilt+", azimuth:"+azimuth+" } \n"
+ "end tell\n";

executeScript(script);
}

void executeScript(String script)
{
NSAppleScript myScript = new NSAppleScript(script);
NSMutableDictionary errors = new NSMutableDictionary();
myScript.execute(errors);
}
Re: controlling GoogleEarth via applescript
Reply #1 - Apr 10th, 2007, 9:55pm
 
This is awesome.
Re: controlling GoogleEarth via applescript
Reply #2 - Apr 10th, 2007, 10:29pm
 
Do you know if there is any way to animate transitions between long/lat locations?  I'm working on a project that projects webcams on a vertical wall, and google earth on the floor.  I want them to be synced, so that when the webcam switches from Time Square New York to Prague, Czech Republic (for example), the projection of Google earth smoothly transitions to the new location.  It would behave like the Google Earth sightseeing play tour feature.
Page Index Toggle Pages: 1