【发布时间】:2021-03-22 01:22:48
【问题描述】:
大家,
我正在尝试使用 rayshader 包获取 3D 地图,但显然该文件太大而无法由 RStudio 处理。以下是部分代码:
(...)
elevation = raster::merge(srtm,srtm2) #works fine
height_shade(raster_to_matrix(elevation)) %>% plot_map() #works fine
piecergb <- raster::stack(piece) #works fine
setValues(piecergb, scales::rescale(values(piecergb), to = c(0, 255)))
Error: cannot allocate vector of size 11.9 Gb
所以,我首先检查了我的 RStudio 的容量:
memory.size()
[1] 27720.21
memory.limit()
[1] 2e+05 ###this I have previously changed with memory.limit(size=200000)
并调用 gc() 来清理我的会话
gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 2766617 147.8 4954078 264.6 4954078 264.6
Vcells 404719527 3087.8 3551300168 27094.3 3774733748 28799.0
然后我重新启动了我的 RStudio,重新定义了内存限制并再次尝试。但我仍然收到相同的错误消息。有人知道如何解决这个问题吗?到目前为止我还没有找到其他解决方案,无法继续绘制地图。
我的系统信息是:
Sys.info()
sysname release version nodename machine login user effective_user
"Windows" "10 x64" "build 18363" "NSF85" "x86-64" "install" "install" "install"
非常感谢您
阿德里安娜
【问题讨论】: