[R-sig-Geo] problem in krige function
Edzer J. Pebesma
e.pebesma at geo.uu.nl
Thu Apr 5 14:51:49 CEST 2007
temiz wrote:
> following the topic GRASS and R kriging interpolation from grass6 tutorial
>
> I came here without problems
>
> But here:
>
> zz <- krige(z ~ 1, locations = el1 , newdata = mask_SG , model = efitted)
> Error in predict.gstat(g, newdata = newdata, block = block, nsim = nsim, :
> var1 : data item in gstat object and newdata have different
> coordinate reference systems
>
> how can I solve this problem ?
>
How about making sure they are equal? If you know they are equal, do
proj4string(el1) = CRS(proj4string(mask_SG))
else use spTransform from rgdal to re-project.
gstat checks that the projection strings are exactly equal; this is a
check too strong, and should be replaced by some check that they
represent exactly the same projection. Does anyone know how to perform
this check?
--
Edzer
More information about the R-sig-Geo
mailing list