plotKML.GDALobj {plotKML}R Documentation

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, CRS=attr(obj, "projection"), 
   plot.legend=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

CRS

character; projection string (if missing)

plot.legend

logical; indicate whether to plot summary legend

Value

Returns a list of KML files.

Note

This operation can be time-consuming for processing very large rasters e.g. more than 10,000 by 10,000 pixels. To speed up writing of KMLs, use the snowfall package.

Author(s)

Tomislav Hengl

See Also

plotKML, kml.tiles

Examples

## Not run: 
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...

## End(Not run)

[Package plotKML version 0.5-9 Index]