Description Usage Arguments Details Author(s) See Also Examples
Writes rasters to PNG images and makes a KML code (ground overlays). Works with "RasterLayer"
and "RasterStack"
class objects. Target attributes can be specified using aesthetics arguments (e.g. "colour"
).
1 2 3 4 5 |
obj |
object of class |
subfolder.name |
character; optional subfolder name |
plot.legend |
logical; specify whether a map legend should be generated automatically |
metadata |
(optional) specify the metadata object |
raster_name |
(optional) specify the output file name (PNG) |
png.width |
(optional) width of the PNG file |
png.height |
(optional) height of the PNG file |
min.png.width |
(optional) minimum width of the PNG file |
TimeSpan.begin |
object of class |
TimeSpan.end |
object of class |
layer.name |
character; optional layer name |
png.type |
character; PNG type |
... |
additional |
Google Earth does not properly handle a 24-bit PNG file which has a single transparent color (read more at Google Earth Help). To force transparency, plotKML will try to set it using the -matte -transparent "\#FFFFFF"
option in the ImageMagick convert program (ImageMagick needs to be installed separately and located using plotKML.env()
). On some Unix run machines the png.type
argument has to be set manually to avoid producing empty PNGs.
Tomislav Hengl, Pierre Roudier and Dylan Beaudette
kml-methods
, kml_open
, kml_layer.RasterBrick
, plotKML-method
1 2 3 4 5 6 7 8 9 10 11 12 | data(eberg_grid)
library(sp)
coordinates(eberg_grid) <- ~x+y
gridded(eberg_grid) <- TRUE
proj4string(eberg_grid) <- CRS("+init=epsg:31467")
data(SAGA_pal)
library(raster)
r <- raster(eberg_grid["TWISRT6"])
## Not run: # KML plot with a single raster:
kml(r, colour_scale = SAGA_pal[[1]], colour = TWISRT6)
## End(Not run)
|
plotKML version 0.6-1 (2020-03-08)
URL: http://plotkml.r-forge.r-project.org/
Warning message:
In showSRID(uprojargs, format = "PROJ", multiline = "NO", prefer_proj = prefer_proj) :
Discarded datum Deutsches_Hauptdreiecksnetz in CRS definition
KML file opened for writing...
Reprojecting to +proj=longlat +datum=WGS84 +no_defs ...
sh: 1: awk: Permission denied
|
| | 0%
|
|================== | 25%
|
|=================================== | 50%
|
|==================================================== | 75%
|
|======================================================================| 100%
Writing to KML...
Closing r.kml
Warning message:
In showSRID(uprojargs, format = "PROJ", multiline = "NO", prefer_proj = prefer_proj) :
Discarded datum Unknown based on Bessel 1841 ellipsoid in CRS definition
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.