我想为以下ASCII raster file确定正确的坐标参考系统:
class : RasterLayer
dimensions : 2160, 4320, 9331200 (nrow, ncol, ncell)
resolution : 0.0833333, 0.0833333 (x, y)
extent : -180, 179.9999, -90, 89.99993 (xmin, xmax, ymin, ymax)
coord. ref. : NA
data source : C:/popc_0AD.asc
names : popc_0AD
我试图通过将CRS设置为一些常见格式并绘制它来猜测正确的投影,如相关帖子中所建议的那样。但我仍然不确定正确的设置。就我而言,raster
和相关的软件包不需要任何能够估计丢失的CRS信息的功能。你知道这个光栅文件的CRS是什么或如何找出来的吗?
范围建议不预测坐标。这似乎是地球的程度。然后,您可能想要使用EPSG 4326,这也是crs="+proj=longlat +datum=WGS84 +no_defs"
:
library(raster)
r <- raster("0AD_lu/cropland0AD.asc")
projection(r) <- "+proj=longlat +datum=WGS84 +no_defs"
但是,使用使用坐标参考系统正确构建的数据集要好得多。永远不建议猜测它......但我知道拥有干净的元数据并不总是可行的......
你有
r <- raster(nrow=2160, ncol=4320, xmn=-180, xmx=179.9999, ymn=-90, ymx=89.99993, crs=NA)
SébastienRochette已经指出这肯定是lon / lat并且你可以设置CRS来重新实现
crs(r) <- "+proj=longlat +datum=WGS84"
在我看来,程度有点怀疑。它看起来应该是一个全局栅格,但是已经有一些精度损失。如果是这样,你可以这样纠正:
extent(r) <- c(-180, 180, -90, 90)
要得到
r
#class : RasterLayer
#dimensions : 2160, 4320, 9331200 (nrow, ncol, ncell)
#resolution : 0.08333333, 0.08333333 (x, y)
#extent : -180, 180, -90, 90 (xmin, xmax, ymin, ymax)
#crs : +proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0