简体   繁体   English

投影(光栅)= NA 但光栅有一组 crs

[英]projection(raster) = NA but raster has a set crs

So I have a list of rasters which have a set crs, resolution and extent etc. I am aiming to merge some of them together however when i try to use the merge function i get the error: Error in as.data.frame(x) : argument "x" is missing, with no default所以我有一个栅格列表,其中有一组 crs、分辨率和范围等。我的目标是将其中一些合并在一起,但是当我尝试使用合并函数时,我收到错误:as.data.frame(x) 中的错误) : 缺少参数“x”,没有默认值

So to investigate this further i ran projection(raster1) and R came back with NA which is confusing because when run 'raster1' it shows a crs assigned to the raster因此,为了进一步调查,我运行了投影(raster1),而 R 返回了 NA,这令人困惑,因为当运行 'raster1' 时,它显示了分配给栅格的 crs

I'm not sure how to set the projection of this list of rasters and was wondering if anyone could help?我不确定如何设置此栅格列表的投影,想知道是否有人可以提供帮助? Ive already tried things like: `sapply(rasters, function(x) projectRaster(x, crs='+proj etc')' 'projection(raster) = '+proj...'' 'crs(raster) = '+proj...''我已经尝试过这样的事情:`sapply(rasters, function(x) projectRaster(x, crs='+proj etc')' 'projection(raster) = '+proj...'' 'crs(raster) = '+项目...''

我最好的猜测是您需要命名列表的第一个元素

names(yourlist) <- c("x", "y")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM