我正在尝试实现这个壮观的可视化工具,唯一似乎阻碍的是能够在 3dplot 上重叠栅格层,这怎么可能?我尝试了 add_overlay,但我不明白如何从错误消息中继续。
library(raster)
library(rayshader)
altc=getData('alt', country='MOZ',mask=T)
elevation_matrix = raster_to_matrix(altc)
y=raster("https://www.dropbox.com/s/zhsu204du0rgbjp/Tlim_margins_Mozambique.grd?dl=0")
mat_reduced <- resize_matrix(elevation_matrix, 0.7)
mat_reduced |>
sphere_shade(texture = create_texture(lightcolor = "white",
shadowcolor = "black",
leftcolor = "grey",
rightcolor = "grey",
centercolor = "grey",
cornercolors = c(NW = "#ffc500",
NE = "#387642",
SW = "#d27441",
SE = "#296176")),
colorintensity=0.12,
sunangle = 45) |>
plot_3d(mat_tx_reduced,
windowsize = c(800, 600),
zscale = 200,
zoom = 0.65,
phi = 80,
theta = 0,
fov = 0,
shadow = TRUE,
shadowcolor = "#5da5da",
water = TRUE,
watercolor= "lightblue",
waterlinecolor="lightblue")|>
add_overlay(overlay=y, alphalayer = 0.5)
Error in .local(x, i = i, j = j, ..., value) : unused argument (value)