查看在 terra 中创建栅格的帮助文件与栅格非常相似,但是,我不断收到“空 srs”错误(对于 terra 中的其他操作也是如此)。
srs是什么?好像和crs一样?为什么要改名?
library(raster)
d <- raster(xmn=1, xmx=17, ymn=46, ymx=57, nrows=1320, ncols = 960, vals = 1, crs = 4326)
library(terra)
d <- rast(xmin=1, xmax=17, ymin=46, ymax=57, nrows=1320, ncols = 960, vals = 1, crs = 4326)
这没有任何意义:
library(terra)
d <- rast(crs = 4326)
因为数字
4326
不是空间/坐标参考系。
您大概想使用该 EPSG 代码。在这种情况下你可以这样做
library(terra)
d <- rast(crs = "EPSG:4326")