kml.tiles {plotKML}R Documentation

Write vector object as tiled KML

Description

Writes vector object as tiled KML. Suitable for plotting large vectors i.e. large spatial data sets.

Usage

kml.tiles(obj, folder.name, file.name, 
   block.x, kml.logo, cpus, home.url=".", desc=NULL, 
   open.kml=TRUE, return.list=FALSE, ...)

Arguments

obj

"SpatialPoints*" or "SpatialLines*" or "SpatialPolygons*"; vector layer

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 aesthetics)

Value

Returns a list of KML files.

Note

This operation can be time-consuming for processing very large vectors. To speed up writing of KMLs, use the snowfall package.

Author(s)

Tomislav Hengl

See Also

plotKML, plotKML.GDALobj

Examples

## Not run: 
library(sp)
library(snowfall)
library(GSIF)
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)

[Package plotKML version 0.5-9 Index]