RGB colors in a raster cube visualization in R

萝らか妹 提交于 2019-12-13 04:25:51

问题


I am using the package mapview to plot a 3D raster cube from a raster stack.

> S2_images
class       : RasterStack 
dimensions  : 660, 1074, 708840, 6  (nrow, ncol, ncell, nlayers)
resolution  : 10, 10  (x, y)
extent      : 219800, 230540, 4097480, 4104080  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=utm +zone=30 +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0 
names       : L2A_T30ST//51_B02_10m, L2A_T30ST//51_B03_10m, L2A_T30ST//51_B04_10m, L2A_T30ST//51_B08_10m, L2A_T30ST//51_B11_20m, L2A_T30ST//51_B12_20m 
min values  :                     1,                   127,                     6,                     1,                    88,                    86 
max values  :                  8702,                  9090,                  7589,                  7322,                  5379,                  5474 

With cubeview(S2_images) I get this visualization with default colors:

My objective is to plot it using RGB colours. For reference, I have created an RGB composition using plotRGB

plotRGB(S2_images, r=3, g=2, b=1, scale=maxValue(S2_images[[1]]), stretch="lin")

According to ?cubeview, col.regiosn should be color (palette).See levelplot for details. Any idea how to proceed to create a color palette out of the RGB composition that I can use as input in the cubeview?

来源:https://stackoverflow.com/questions/54553138/rgb-colors-in-a-raster-cube-visualization-in-r

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!