View source: R/plotKML.GDALobj.R
plotKML.GDALobj | R Documentation |
Write tiled objects to KML. Suitable for plotting large rasters i.e. large spatial data sets.
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)
obj |
|
file.name |
character; output KML file name |
block.x |
numeric; size of block in meters or corresponding mapping units |
tiles |
data.frame; tiling definition |
tiles.sel |
integer; selection of tiles to be plotted |
altitude |
numeric; altitude of the ground overlay |
altitudeMode |
character; either |
colour_scale |
character; color palette |
z.lim |
numeric; upper lower boundaries |
breaks.lst |
numeric; optional break lines (must be of size |
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 |
Returns a list of KML files.
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.
Tomislav Hengl
plotKML
, kml.tiles
## Not run: library(sp) library(snowfall) 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 'gdalUtilities::gdalwarp', then tile... ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.