Omegahat Statistical Computing

Ideas for statistical computing

Posts Tagged ‘KML’

R plots and Google Earth in the browser

Posted by omegahat on March 12, 2010

In addition to playing with KML as a graphics device, I wrote up some notes that introduce how to put Google Earth into a Web browser and then use elements of the JavaScript API for Google Earth. This progresses to show how to add HTML form elements such as buttons and checkboxes to control the Google Earth display. And it ends by showing how to put an SVG plot created in R beside the Google Earth plugin and have that SVG plot be interactive. As the viewer moves the mouse over the time series in the R plot, the Google Earth display is rotated to show the corresponding US city.  The example is not necessarily very compelling, but the mechanism should allow us to do a lot more interesting things.

Posted in Graphics, Uncategorized | Tagged: , , , , | Leave a Comment »

RKMLDevice – R plots in KML

Posted by omegahat on March 12, 2010

One thing I have been tinkering with recently is the ability to create R plots as KML.  This is implemented in the RKMLDevice package on Omegahat. One creates a regular graphics device with the function kmlDevice() and issue regular R commands to generate the plot.  One can then display the resulting document in Google Earth (either stand-alone or the browser plugin) and the R plot will appear centered at the coordindates specified when creating the device.  This is not a PNG image, but the graphical elements in the plot are regular KML elements, i.e. Placemark elements.  This means they scale well. Also, they appear in the Folder for the plot and one can toggle their visibilities. There are some examples at http://www.omegahat.org/RKMLDevice/examples.

Posted in Graphics, Uncategorized | Tagged: , , , | Leave a Comment »