addDataFolder: Create a new Folder element within the documnt

Description Usage Arguments Value Author(s) References

Description

These two functions allow the caller to add a new Folder within a KML Document. A folder is used to store grouped information and these are arranged and controlled hierarchically within the KML Document. That is we can make elements of a Folder visible or invisible collectively and this setting applies to all elements within the folder's hierarchy.

addFolder creates a simple folder element, giving it a name and an optional id.

addDataFolder creates a folder and populates it with Placemark sub-elements corresponding to the observations/rows in the specified data frame. The data frame is assumed to have variables named longitude and latitude points on the map are added at each of these for each time. And the elements are connected in time by a line. The appearances of the points and the lines are controlled by the elements of col and lty which are the names of styles within the document.

addDataFolder is used in the kmlPanel.deault function used, by default, in kmlTime.

Usage

1
2
3
4
5
6
7
8
9
addDataFolder(data, times,
              folder = newXMLNode("Folder", if(length(id) > 0) attrs = c(id = id)), 
              col = "red", lty = "a", id = character(), addLines = FALSE,
              name = if(length(base:::names(times)))
                         base:::names(times)
                      else
                         times,
              description = name, dateFormat = "%Y-%m-%dT%H:%M:%S")
addFolder(name, id = character(), parent = NULL)

Arguments

data

the data frame giving the observations for each time point. This is assumed to have variables named longitude and latitude

times

a variable giving the times

folder

the XML Folder node, typically not specified

col

character vector giving the style for the points. These should be "anchored", i.e. start with \# to refer to the style within this Document, or be URLs.

lty

character vector giving the style for the lines joining the points

id

the value of the id attribute used to identify this node (not the name/label)

name

the label for this Folder which is displayed in the Places panel of the Google Earth GUI.

parent

the parent XML node for the new Folder node.

addLines

a logical value indicating whether to connect successive points with a line. This is useful when the points are related and represent a path.

names

the names to use to display for each point

description

a character vector with as many elements as there are points providing HTML content that is to be displayed when the viewer clicks on a point.

dateFormat

a string specifying the format for generating the date strings from POSIXt objects. This allows the caller to customize the generation of the date-time strings.

Value

The newly created Folder XML node.

Author(s)

Duncan Temple Lang

References

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


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