createKMLDoc: Create the top-level KML Document

Description Usage Arguments Value Author(s) References See Also

Description

This creates the XML document to represent a KML document. Google Earth can display multiple KML document objects simultaneously.

In addition to creating the top-level <kml> node, it also creates the <Document> and populates it with meta data. This gives the document a name that appears in the "Places" panel of the Google Earth display. The description is the HTML text that is displayed if the viewer clicks on the Folder entry for this document in the "Places" view.

We can also specify the initial view or "window" for this document which Google Earth will move to if the viewer selects this document by double-clicking on it.

Usage

1
2
createKMLDoc(docName, description, window = c(longitude = 0, latitude = 0),
               data = NULL, ns = character())

Arguments

docName

the name to use in the Places panel

description

a description of this document. This can contain HTML markup. It can be the name of a file in which case its contents are used as the text for the description. To avoid this, use I("the actual text"). Alternatively, this can be a connection and the contents will be read. Also, one can pass an XML node.

window

a vector containing named values for specifying the initial "view" for this document. This is passed to createLookAt. The important elements are longitude and latitude.

data

an optional data frame assumed to have variables named longitude and latitude

ns

a character vector giving the names pace for the top-level node. This defaults to kml as the prefix and "http://earth.google.com/kml/2.2" as the URI. One can remove the namespace by specifying an empty character vector. Google Earth works with either but the presence of the namespace is "more correct".

Value

An object of class KMLDoc which is the top-level XML internal document.

Author(s)

Duncan Temple Lang

References

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

See Also

kmlTime kml


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