createUpdatingDoc: Create KML document that reloads another document at regular...

Description Usage Arguments Details Value Author(s) References Examples

Description

This function creates a simple KML document that references another KML document and arranges to reload that second file at regular intervals. This can be used when the contents of the second file are changing regularly. This might be because the data are changing, or becuase we are experimenting with the KML file and want to see it updated. This is convenient for debugging the creation of KML fliles, but is also

Usage

1
2
3
4
createUpdatingDoc(targetFile, interval = 5, window = c(),
                   docName = targetFile,
                    description = sprintf("Updating of %s file", targetFile),
                     out = NA, ..., doc = createKMLDoc(targetFile, description, window, ...))

Arguments

targetFile

the name of the file to reload at regular intervals

interval

the number of seconds between reloading the target file

window

the coordinates to view when the file is loaded

docName

a string to display in Google Earth's "Places" list that identifies this document (not the one it loads)

description

a string giving a more detail description of this document.

out

if not empty or NA this is the name of a file to which to write the new KML file that updates the display of targetFile. In other words, this writes the updating file and this is the name of that new updating file.

...

additional arguments passed on to create the XML/KML document

doc

the KML document object that is created and returned. The caller can provide this to control its creation but allow the function to fill in the information within the document.

Details

This creates a KML document with a NetworkLink element.

Value

An object of class KMLDoc which is an XML document.

Author(s)

Duncan Temple Lang

References

http://code.google.com/apis/kml/documentation/kmlreference.html#networklink

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(RKML)
dyn = createUpdatingDoc("foo.kml")
saveXML(dyn, "dyn.kml")

if(Sys.info()["sysname"] == "Darwin")
   system("open dyn.kml")

data(USCities)
foo = kml( ~ longitude + latitude, USCities[1:50,])
saveXML(foo, "foo.kml")

duncantl/RKML documentation built on May 15, 2019, 5:31 p.m.