Be sure to reclassify your raster data using the Reclassify tool. Then, run the Raster to Polygon
tool and it should run fine. What's happening with the "incorrect data format" error is that you have a continuous (smooth) raster, and it is trying to convert that to a polygon.
You will find all you need in the excellent (and didactic) technical note from Rossiter (2012)*:
Technical Note: Co-kriging with the gstat package of the R environment for statistical computing.
Co-kriging will use different functions from those with univariate kriging (for example, ordinary kriging).
The datasets (target and co-variables) should remain in separate data frames, but within the same object of class gstat
. And predictions (interpolation) are carried out with predict.gstat
.
In Rossiter (2012), chapters 6 and 7 explain in details how to do it:
- (6) Modelling a bivariate co-regionalisation.
- (7) Co-kriging with one co-variable.
Below is the main code from Rossiter (2012) which addresses the question. It uses the meuse
dataset as example:
g <- gstat(NULL, id = "ltpb", form = ltpb ~ 1, data=meuse.pb) #target variable lead (pb).
g <- gstat(g, id = "ltom", form = ltom ~ 1, data=meuse.co) #co-variable organic matter (om).
v.cross <- variogram(g) #generate direct variograms and the cross-variogram.
g <- gstat(g, id = "ltpb", model = m.ltpb.f, fill.all=T) #add variogram models to gstat object. In this case, it has been used the variogram model. fitted to the target variable in previous chapter, for both target variable and the co-variable as starting points.
g <- fit.lmc(v.cross, g) #fit theoretical variograms to experimental ones (uses linear model of co-regionalisation).
k.c <- predict.gstat(g, meuse.grid) #predicts values for target variable in the prediction grid.
*Rossiter, D.G. 2012. Technical Note: Co-kriging with the gstat package of the R environment for statistical computing. University of Twente, Faculty of Geo-Information Science & Earth. Observation (ITC). Enschede (NL). Revision 2.3. 84p.
Best Answer
CRAN package gstat comes with functions for spatio-temporal variogram modelling and prediction. The vignettes on this topic might be a good starting point.
demonstrates ST kriging using a local neighbourhood.