Interpolating Gridded 3D Data to a finer scale

断了今生、忘了曾经 提交于 2019-12-06 10:37:21

This is the solution I think you're looking for, which uses bilinear resampling. However this is not the only way to do such interpolation and you'd likely need to justify not using a more sophisticated approach (e.g. geostatistical, splines, etc.):

library(raster)
set.seed(2002)

##  Create an extent boundary:
ex <- extent(c(0, 20, 0, 20))

##  Simulate a coarse raster:
r.small <- raster(ex, vals=rnorm(10*10, mean=5, sd=1), nrow=10, ncol=10)

##  Simulate the grid of a finer-scale raster:
r.big <- raster(ncol=200, nrow=200, ext=ex)

##  Resample the coarser raster to match finer grid:
r.res <- resample(x=r.small, y=r.big, method="bilinear")

plot(r.small)
plot(r.res)

Coarse:

Fine:

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!