【问题标题】:autokriging and SpatialPixel grid file自动克里金法和 SpatialPixel 网格文件
【发布时间】:2021-01-15 15:51:13
【问题描述】:

我正在尝试在 automap 包中使用 autoKrige。 我的数据看起来像

head(LL12)

  Location Longitude  Latitude   percent
1       L1  16.48476 -28.60737 1.0000000
2       L3  16.90045 -29.24154 1.0000000
3       L4  16.99268 -28.44906 0.6363636
4       L5  17.06871 -29.67825 1.0000000
5       L6  17.09935 -29.00169 0.6000000
6       L7  17.25630 -28.82418 1.0000000

我正在尝试在南非地图上绘制它。

首先我得到Create Grid in R for kriging in gstat之后的网格

SAgrd <- makegrid(SApol_border, n = 1000)

colnames(SAgrd) <- c('lon','lat')

SAgrd_pts <- SpatialPoints(coords = SAgrd, 
                           proj4string=CRS(proj4string(SApol_border)))


SAgrd_pts_in <- SAgrd_pts[SApol_border, ]

plot(SAgrd_pts_in)

plot(SAgrd_pts_in)

然后我将其转换为 SpatialPixel 数据帧

SAgrd_pts_in = as(SAgrd_pts_in,"SpatialPixelsDataFrame") 

plot(SAgrd_pts_in) 给出以下错误消息:

.subset2(x, i, exact = exact) 中的错误:下标超出范围

当我想在自动克里金法中使用以下行时也会给出错误消息

krigLL12_fit <- autoKrige(percent~1, SA.grid, LL12spdf) # percent is the variable of interest in the spdf LL12spdf

错误信息:

autoKrige 中的错误(百分比 ~ 1,SA.grid,LL12spdf): input_data 或 new_data 在 LongLat 中,请重新投影。 输入数据:+proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs 新数据:不适用 另外:警告信息: 1:在 proj4string(input_data) 中: CRS 对象有注释,在输出中丢失 2:在 proj4string(input_data) 中: CRS 对象有注释,在输出中丢失 3:在 showSRID(uprojargs, format = "PROJ", multiline = "NO") : 基于 WGS84 椭球在 CRS 定义中的废弃数据未知, 但 +towgs84= 保留值

我是这个主题的新手,无法意识到我需要做什么或纠正什么,坐标单位在网格和数据文件中看起来相同。我还安装了自变量函数并尝试在 autokrige 中使用,但它也不起作用。谢谢。

【问题讨论】:

    标签: r mapping kriging


    【解决方案1】:

    我发现了问题:将 NA 应用于其 crs 所需的网格文件,然后将其转换为 Spatial Pixels 文件,而不是 Spatial Pixels Data Frame。 我对此进行了扩展,其中包含代码和结果 https://gis.stackexchange.com/questions/375476/0-0-kriging-error-messages-grid-file-problem-automap-gstat

    【讨论】:

      猜你喜欢
      • 2012-06-16
      • 2017-09-12
      • 2013-11-24
      • 2020-11-15
      • 2020-09-01
      • 2013-05-01
      • 2018-08-09
      • 2015-01-26
      • 2015-12-03
      相关资源
      最近更新 更多