
Last chance! 50% off unlimited learning
Sale ends in
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)
"GDALobj"
object i.e. a pointer to a spatial layer
character; output KML file name
numeric; size of block in meters or corresponding mapping units
data.frame; tiling definition
integer; selection of tiles to be plotted
numeric; altitude of the ground overlay
character; either "absolute"
, "relativeToGround"
or "clampToGround"
character; color palette
numeric; upper lower boundaries
numeric; optional break lines (must be of size length(colour_scale)+1)
character; optional project logo file (PNG)
logical; specifies whether to overwrite PNGs if available
integer; specifies number of CPUs to be used by the snowfall package to speed things up
character; optional web-directory where the PNGs will be stored
character; optional layer description
logical; specifies whether to open the KML file after writing
character; projection string (if missing)
logical; indicate whether to plot summary legend
Returns a list of KML files.
# 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...
# }
Run the code above in your browser using DataLab