kml_legend.whitening | R Documentation |
Produces a PNG file that can be used in KML plots (visualization of uncertainty).
kml_legend.whitening(legend.res = 0.01, width = 120, height = 300, pointsize = 14, x.lim, e.lim, leg.asp = 0.3 * width/height, legend.file = "whitening_legend.png", matte = FALSE, png.type)
legend.res |
numeric; resolution on a 0-1 scale |
width |
integer; image width |
height |
integer; image height |
pointsize |
integer; point size in units for text |
x.lim |
numeric; upper and lower limits for target variable |
e.lim |
numeric; upper and lower limits for the normalized error |
leg.asp |
numeric; legend aspect |
legend.file |
character; output PNG file name |
matte |
logical; specify whether to fix transparency using ImageMagick |
png.type |
character; PNG type |
The output PNG file shows a 2D legend with values on the vertical axis and uncertainty on the horizontal axis. Whitening is only valid with Hue-Saturation-Intensity system where Hue's are used to represent values of the target variable, so that the amount of white color can be linearly used to represent uncertainty (i.e. whitening can not be used with different color palettes; or at least we do not recommend this).
Google Earth does not properly handle a 24-bit PNG file which has a single transparent color. In order to force transparency in the output PNG, the function with try using ImageMagick convert function. ImageMagick needs to be installed separately and located using plotKML.env()
.
Tomislav Hengl
Hengl, T., Heuvelink, G.M.B., Stein, A., (2004) A generic framework for spatial prediction of soil variables based on regression-kriging. Geoderma 122 (1-2): 75-93. doi: 10.1016/j.geoderma.2003.08.018
Hengl, T., (2003) Visualisation of uncertainty using the HSI colour model: computations with colours. 7th International Conference on GeoComputation (CD-ROM), p. 8.
whitening
## Not run: # create the 2D legend for whitening (PNG file): kml_legend.whitening(x.lim=c(5,20), e.lim=c(.6,1)) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.