kml.tiles: Write vector object as tiled KML

Description Usage Arguments Value Note Author(s) See Also Examples

View source: R/kml.tiles.R

Description

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

Usage

1
2
3
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## Not run: 
library(sp)
library(snowfall)
library(landmap)
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)

plotKML documentation built on April 27, 2021, 3:01 p.m.