Skip to content
Prev 22056 / 29559 Next

rainfall interpolation using ANN

Hi Nahm Lee and R-sig-geo,

I am quite interested in the IDW interpolation comparing to other methods
such as Krige, I have a code like this which I think also did the IDW:

library(gstat)
library(maptools)
library(raster)
dat71 <- readShapePoints("d:/FireDanger/IDW/71stations.shp")
bubble(dat71,"VALUE1")
sample.grid <- raster("rawsd_71Stations.tif")
Left <- bbox(sample.grid)[1]
Right <- bbox(sample.grid)[3]
Bottom <- bbox(sample.grid)[2]
Top <- bbox(sample.grid)[4]
cell.size <- res(sample.grid)
grid.xy <- expand.grid(x = seq(Left, Right, cell.size[1]), y = seq(Top,
Bottom, -cell.size[2]))
coordinates(grid.xy) <- ~x + y
gridded(grid.xy) = TRUE
value71.idw <- krige(VALUE1 ~ 1, dat71, grid.xy)
spplot(value71.idw["var1.pred"])
r_grid71 <- raster(value71.idw["var1.pred"])
plot(r_grid71)

However, I am not sure it is correct. Have someone using this method to do
the IDW? and One more question, How can I complete a Krige application
based on a shapefile (there are other examples using the spreedsheet).

Looking forward to hearing from you.

Peter
On Mon, Dec 1, 2014 at 12:31 PM, Nahm Lee <nlee at valleywater.org> wrote:

            
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20141202/b7954585/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 14586 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20141202/b7954585/attachment.png>