I wonder if there is a way to interpolate xyz points in a raster within certain bounds using R? In ArcGIS this is called interpolation with barriers. I wonder if there is something similar in R? I would like to use the kriging method.
[GIS] Kriging with barriers in R
barriersinterpolationkrigingrraster
Best Answer
You can use the
gdistance
package to create a cost surface raster, then use theshortestPath
function to compute the distances between all your data points. You then need to do your interpolation using that distance matrix as your distance metric and not pythagoras. I think gstat will let you feed in a distance matrix for kriging.You'll probably also need to use
shortestPath
to compute the distances between your data points and the grid points for your interpolated grid when you come to compute the mean and variance of your kriging estimates over your space.Assuming this is really two-dimensional...
There was a thread on R-sig-geo in 2010 that is relevant and there was a solution using GRASS to compute the distances and a modified geoR to do the kriging:
http://www.mail-archive.com/r-sig-geo@stat.math.ethz.ch/msg06855.html