Writes object of class "SpatialPolygons*"
to KML with a possibility to parse attribute variables using several aesthetics arguments.
kml_layer.SpatialPolygons(obj, subfolder.name = paste(class(obj)),
extrude = TRUE, tessellate = FALSE,
outline = TRUE, plot.labpt = FALSE, z.scale = 1,
LabelScale = get("LabelScale", envir = plotKML.opts),
metadata = NULL, html.table = NULL, TimeSpan.begin = "",
TimeSpan.end = "", colorMode = "normal", …)
object of class "SpatialPolygons*"
character; optional subfolder name
logical; specifies whether to connect the point to the ground with a line
logical; specifies whether to connect the LinearRing to the ground
logical; specifies whether to outline the polygon
logical; specifies whether to add the label point (polygon centre)
numeric; exaggeration in vertical dimension
numeric; scale factor for size of labels
(optional) specify the metadata object
optional description block (html) for each GPS point (vertices)
(optional) beginning of the referent time period
(optional) end of the referent time period
(optional) KML color mode (normal or random)
additional style arguments (see aesthetics
)
Label points are be default not plotted. We recommend adding the legend to attribute maps instead. Transparency can be set by using the alpha argument.
TimeSpan.begin
and TimeSpan.end
are optional TimeStamp vectors:
yyyy-mm-ddThh:mm:sszzzzzz
Use the same time values for both TimeSpan.begin
and TimeSpan.end
if the measurements refer to a single moment in time. TimeSpan.begin
and TimeSpan.end
can be either a single value or a vector of values.
# NOT RUN {
library(rgdal)
library(sp)
data(eberg_zones)
names(eberg_zones)
## visualize zones using random colors:
kml(eberg_zones, colorMode = "random")
## with labels:
kml(eberg_zones, colour = ZONES, plot.labpt = TRUE,
labels = ZONES, kmz = TRUE, balloon=TRUE)
# }
Run the code above in your browser using DataLab