Learn R Programming

plotKML (version 0.5-4)

plotKML.GDALobj: Write tiled objects to KML

Description

Write tiled objects to KML. Suitable for plotting large rasters i.e. large spatial data sets.

Usage

plotKML.GDALobj(obj, file.name, block.x, tiles=NULL, 
   tiles.sel=NULL, altitude=0, altitudeMode="relativeToGround", colour_scale, 
   z.lim=NULL, breaks.lst=NULL, kml.logo, overwrite=TRUE, cpus, 
   home.url=".", desc=NULL, open.kml=TRUE)

Arguments

obj
"GDALobj" object i.e. a pointer to a spatial layer
file.name
character; output KML file name
block.x
numeric; size of block in meters or corresponding mapping units
tiles
data.frame; tiling definition generated using GSIF::tile
tiles.sel
integer; selection of tiles to be plotted
altitude
numeric; altitude of the ground overlay
altitudeMode
character; either "absolute", "relativeToGround" or "clampToGround"
colour_scale
character; color palette
z.lim
numeric; upper lower boundaries
breaks.lst
numeric; optional break lines (must be of size length(colour_scale)+1)
kml.logo
character; optional project logo file (PNG)
overwrite
logical; specifies whether to overwrite PNGs if available
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

Value

  • Returns a list of KML files.

See Also

plotKML, kml.tiles

Examples

Run this code
library(sp)
library(snowfall)
library(GSIF)
library(rgdal)
fn = system.file("pictures/SP27GTIF.TIF", 
 package = "rgdal")
obj <- GDALinfo(fn)
tiles <- getSpatialTiles(obj, block.x=5000, 
  return.SpatialPolygons = FALSE)
## plot using tiles:
plotKML.GDALobj(obj, tiles=tiles, z.lim=c(0,185))
## Even better ideas is to first reproject 
## the large grid using 'gdalUtils::gdalwarp', then tile...

Run the code above in your browser using DataLab