kml.tiles | R Documentation |
Writes vector object as tiled KML. Suitable for plotting large vectors i.e. large spatial data sets.
kml.tiles(obj, obj.lst, folder.name, file.name, block.x, kml.logo, cpus, home.url=".", desc=NULL, open.kml=TRUE, return.list=FALSE, ...)
obj |
|
obj.lst |
|
folder.name |
character; KML folder name |
file.name |
character; output KML file name |
block.x |
numeric; size of block in decimal degrees (geographical coordinates) |
kml.logo |
character; optional project logo file (PNG) |
cpus |
integer; specifies number of CPUs to be used by the snowfall package to speed things up |
home.url |
character; optional web-directory where the PNGs will be stored |
desc |
character; optional layer description |
open.kml |
logical; specifies whether to open the KML file after writing |
return.list |
logical; specifies whether to return list of tiled objects |
... |
(optional) aesthetics arguments (see |
Returns a list of KML files.
This operation can be time-consuming for processing very large vectors. To speed up writing of KMLs, use the snowfall package.
Tomislav Hengl
plotKML
, plotKML.GDALobj
## Not run: library(sp) library(snowfall) library(rgdal) data(eberg) coordinates(eberg) <- ~X+Y proj4string(eberg) <- CRS("+init=epsg:31467") ## plot using tiles: shape = "http://maps.google.com/mapfiles/kml/pal2/icon18.png" # tiles.p <- kml.tiles(eberg["SNDMHT_A"], block.x=0.05, # size=0.8, z.lim=c(20,50), colour=SNDMHT_A, shape=shape, # labels=SNDMHT_A, return.list=TRUE) ## Returns a list of tiles # data(eberg_contours) # tiles.l <- kml.tiles(eberg_contours, block.x=0.05, # colour=Z, z.lim=range(eberg_contours$Z), # colour_scale=SAGA_pal[[1]], return.list=TRUE) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.