【问题标题】:Stacking tiff rasters堆叠 tiff 栅格
【发布时间】:2018-04-25 14:45:14
【问题描述】:

我正在尝试从 15 个森林覆盖的栅格层创建一个多时态栅格。我首先设置工作目录,列出目录中的文件,并尝试按时间顺序堆叠这些栅格。

##Listing raster layers in the working directory
list <- list.files(getwd(), pattern=".tif$", all.files=TRUE)
list

##Creating a multi-temporal raster object
stackName <- timeStack(x=list, pattern=".tif$", orderChrono=TRUE, overwrite=TRUE)

我得到的错误是

row.names 中的错误tmp, value = sourcefile) : 不允许重复 row.names 另外:警告信息: 1:在 getSceneinfo(x) 中: 提供的某些字符不包含可识别的 Landsat5/7/8 场景 ID 2:设置'row.names'时的非唯一值:'Not recognised'

你能帮忙吗?

【问题讨论】:

    标签: raster


    【解决方案1】:

    我觉得应该是

    library(bfastSpatial)
    s <- timeStack(x=list, orderChrono=TRUE)
    

    当 x 是文件名列表时,pattern 参数是多余的。如果您不提供输出文件名,overwrite 将毫无意义。

    你也可以这样做:

    library(raster)
    s <- stack(list)
    

    也许在对list 进行排序之后。为了进一步帮助您,您应该显示list的内容。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-04-30
      • 2017-07-14
      • 2021-10-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多