[R-sig-Geo] Kriging wiht anisotropy modeling using great circle distance in gstat [SEC=UNCLASSIFIED]

Jin.Li at ga.gov.au Jin.Li at ga.gov.au
Fri Aug 19 03:37:59 CEST 2011


Hi All,

I tried to do kriging with anisotropy using great circle distance as bellow. 

> library(gstat)
> loadMeuse()
> 
> require(rgdal)
>   proj4string(meuse) = CRS("+init=epsg:28992")
>   meuse.ll = spTransform(meuse, CRS("+proj=longlat"))
> 
> data(meuse.grid)
>   coordinates(meuse.grid) = ~x+y
>   proj4string(meuse.grid) = CRS("+init=epsg:28992")
>   meuse.grid.ll = spTransform(meuse.grid, CRS("+proj=longlat"))
>
> v =  variogram(zinc~1,meuse, alpha=c(0, 45, 90, 135), tol.hor=45)  
> m1<-fit.variogram(v, vgm(1, "Exp", 3,  anis=c(90,0.1)))
>   ok<-krige(log(zinc)~1, meuse.ll, meuse.grid.ll, m1)
[using ordinary kriging]
Error in predict.gstat(g, newdata = newdata, block = block, nsim = nsim,  : 
  gstat: value not allowed for: for long/lat data, anisotropy cannot be defined
>  

It produced an error message as above. If the anisotropy specification is removed, it works.

This was done in: 
> Sys.info()
  sysname                      release                      version 
  "Windows"                    "XP"         "build 2600, Service Pack 3" 
                                      
Is there anything wrong in my code or it is a bug? Any suggestions are appreciated!

Regards,
Jin           



More information about the R-sig-Geo mailing list