kml_layer-methods {plotKML} | R Documentation |
Writes any Spatial*
object (from the sp package), spatio-temporal object (from the ST-class
package) or Raster*
object (from the raster package) to a KML file (connection) as a separate layer. Various aesthetics, i.e. ways to represent target variables, can be set via colour, transparency, size, width, shape arguments. Their availability depends on the class of the object to plot.
kml_layer(obj, ...)
obj |
object inheriting from the |
... |
additional aesthetics arguments; see details for each |
An XML object that can be further parsed to a KML file (via an open connection).
Pierre Roudier, Tomislav Hengl and Dylan Beaudette
kml_layer.SpatialPoints
, kml_layer.Raster
, kml_layer.SpatialLines
, kml_layer.SpatialPolygons
, kml_layer.STIDF
, kml_layer.STTDF
, kml_layer.SoilProfileCollection
, kml-methods
, kml_open
, kml_close
library(rgdal) data(eberg_grid) library(sp) library(raster) gridded(eberg_grid) <- ~x+y proj4string(eberg_grid) <- CRS("+init=epsg:31467") data(SAGA_pal) data(R_pal) ## Not run: # Plot two layers one after the other: kml_open("eberg_grids.kml") kml_layer(eberg_grid, colour=DEMSRT6, colour_scale=R_pal[["terrain_colors"]]) kml_layer(eberg_grid, colour=TWISRT6, colour_scale=SAGA_pal[[1]]) kml_close("eberg_grids.kml") # print the result: library(XML) xmlRoot(xmlTreeParse("eberg_grids.kml"))[["Document"]] ## End(Not run)