0

I have been playing around with the krigeST function in the gstat package, and I tried to do local kriging with a full set of SpatialPolygons based data (STFDF).

When I tried the following

spatio_time_krige_sumProd = krigeST(conso~1, 
                                    some_STFDF_with_SpatialPolygons_in_sp, 
                                    newdata = some_STF_with_SpatialPolygons_in_sp,                      
                                    fitted_prodSum_variogram, 
                                    nmax = 50, 
                                    stAni = 4)
Error in from@sp[from@index[, 1], ] : 
   SpatialPolygons selection: can't find plot order if polygons are replicated

What seems to be the problem is that in krigeST.local, the some_STFDF_with_SpatialPolygons_in_sp is coerced into a SFIDF. In that, there is a subsetting step which is not allowed by the SpatialPolygons class, since there are repeated terms in from@index[, 1].

I'd like to try non-separable spatio-temporal variogram, so not using local kriging isn't really an option. Is there a workaround for this problem?

Thanks.

vermouth
  • 301
  • 2
  • 12
  • Kriging is usually thought as interpolating from observed points to non-observed points. Why do you pass polygons to the function? – Edzer Pebesma Oct 30 '15 at 08:13
  • My data is actually area-based, so to be really rigorous, I should probably consider block spatio-temporal kriging. However that seems to be much more expensive computationally. Maybe I should just remplace the polygons with their geometric centers. – vermouth Oct 30 '15 at 11:34
  • It's called area-to-point (or area-to-area) kriging. I cannot recommend replacing the polygons with their center points. – Edzer Pebesma Oct 30 '15 at 15:14

0 Answers0