【发布时间】:2023-03-26 19:55:01
【问题描述】:
假设我有以下名为 newTemplate 的 RasterLayer:
class : RasterLayer
dimensions : 139615, 184156, 25710939940 (nrow, ncol, ncell)
resolution : 50, 50 (x, y)
extent : 668395.5, 9876195, 2620826, 9601576 (xmin, xmax, ymin, ymax)
crs : +proj=utm +zone=17 +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0
由此,我想直接提取与 ncell 对应的值,即不通过 nrow 和 ncol 的乘法。我该怎么做?原因是这种间接方法在 R 中返回以下警告消息:
[1] NA
Warning message:
In newTemplate@ncols * newTemplate@nrows : NAs produced by integer overflow
【问题讨论】: