Hi Greg,

Just a small remark: it would not be a special treatment because I am anyway 
80% of my time located in Amsterdam  ;)

Edzer, thanx for fixing this problem. I did run kriging on LatLon projected 
data a lot actually. LatLon coordinates are especially attractive because you 
can then directly export the resulting maps to Google Earth.

cheers,

Tom Hengl
http://spatial-analyst.net 


-----Original Message-----
From: [EMAIL PROTECTED] on behalf of Greg Lee
Sent: Fri 31/10/2008 9:45 AM
To: Edzer Pebesma
Cc: r-sig-geo@stat.math.ethz.ch
Subject: Re: [R-sig-Geo] gstat::variogram - distance calculation isincorrect; 
kriging on sphere
 
No sign of sp 0.9-27 at this end (Melbourne, Australia) yet. Interesting
that it should take so long.

I temporarily reset my repository to access the updates. Croatia already has
sp 0.9-28, along with gstat 0.9-53. (Does Tomislav receive special
treatment?)
Your example now works perfectly. Thank you.

Greg.


2008/10/31 Edzer Pebesma <[EMAIL PROTECTED]>

> That's right; my fault that I sent the email and updated the sp package on
> CRAN almost at the same time. The new sp (0.9-27 would suffice) should now
> have propagated to your mirror, simply update your sp package again and it
> should work. Let me know if it doesn't.
> --
> Edzer
>
> Greg Lee wrote:
>
>>  Hello Edzer,
>>
>> I was curious to run the example you provided (using the latest CRAN
>> versions of all packages), but as written the line
>>
>>
>>
>>> idw.spdf = as(idw.out, "SpatialPolygonsDataFrame")
>>>
>>>
>>
>> produces
>>
>> Error in as(idw.out, "SpatialPolygonsDataFrame") :  no method or default
>> for
>> coercing "SpatialPixelsDataFrame" to "SpatialPolygonsDataFrame"
>> Regards,
>> Greg.
>>
>>
>> 2008/10/30 Edzer Pebesma <[EMAIL PROTECTED]>
>>
>>
>>
>>> Dear all,
>>>
>>> In continuation of this thread, I've spent some time looking at kriging
>>> on
>>> the sphere, corrected some bugs, and need further help.
>>>
>>> First of all, distances for covariances on the sphere were computed
>>> incorrectly as well in gstat, so I hope not too many people have been
>>> relying on this--kriging seemed to happen still in some Euclidian mode.
>>> The
>>> good news is that it seems to work now (gstat 0.9-53, accepted on CRAN).
>>> Inverse distance interpolation for spherical data seemed to work already.
>>>
>>> Covariances on the sphere now work, but the models present do not include
>>> those specially deviced for spherical data. Can anyone provide me with or
>>> point me to useful, preferably simple covariance functions that are
>>> positive
>>> definite on the sphere? The example below seems to work but in certain
>>> cases
>>> without nugget the interpolation may go crazy. You'll need to update your
>>> sp
>>> to 0.9-27 to run it (also accepted on CRAN).
>>>
>>> Below is an example script. It also needs the new sp and gstat versions.
>>>
>>> library(gstat)
>>> library(rgdal)
>>> world = expand.grid(long=seq(-177.5,177.5,5),lat=seq(-87.5,87.5,5))
>>> world.sp = SpatialPixels(SpatialPoints(world,CRS("+proj=longlat")))
>>> plot(world.sp,axes=T)
>>>
>>>
>>> pts=data.frame(long=runif(100,-180,180),lat=runif(100,-90,90),val=rnorm(100))
>>> coordinates(pts)=~long+lat
>>> proj4string(pts)=CRS("+proj=longlat")
>>> points(pts,col='red')
>>>
>>> # inverse distance interpolation on the sphere:
>>> idw.out = idw(val~1,pts,world.sp)
>>> image(idw.out, axes = TRUE, ylim = c(-90,90))
>>> points(pts, pch=3)
>>> idw.spdf = as(idw.out, "SpatialPolygonsDataFrame")
>>> newproj = CRS("+proj=moll")
>>> idw.spdf.moll = spTransform(idw.spdf, newproj)
>>> spplot(idw.spdf.moll, "var1.pred",col.regions=bpy.colors(),col=0,
>>>  sp.layout = list(sp.points, spTransform(pts, newproj), col = 'black'))
>>>
>>> # kriging on the sphere
>>> kr.out = krige(val~1,pts,world.sp,vgm(1, "Exp", 3000))
>>> idw.spdf.moll$kr = kr.out[[1]]
>>> spplot(idw.spdf.moll, "kr", col.regions=bpy.colors(), col=0,
>>>  sp.layout = list(sp.points, spTransform(pts, newproj), col = 'black'))
>>>
>>> --
>>> Edzer Pebesma
>>> Institute for Geoinformatics (ifgi), University of Münster
>>> Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251
>>> 8333081, Fax: +49 251 8339763 http://ifgi.uni-muenster.de/
>>> http://www.springer.com/978-0-387-78170-9 [EMAIL PROTECTED]
>>>
>>>
>>> _______________________________________________
>>> R-sig-Geo mailing list
>>> R-sig-Geo@stat.math.ethz.ch
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>>
>>>
>>>
>>>
>>
>>        [[alternative HTML version deleted]]
>>
>>  ------------------------------------------------------------------------
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo@stat.math.ethz.ch
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>>
>
> --
> Edzer Pebesma
> Institute for Geoinformatics (ifgi), University of Münster
> Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251
> 8333081, Fax: +49 251 8339763 http://ifgi.uni-muenster.de/
> http://www.springer.com/978-0-387-78170-9 [EMAIL PROTECTED]
>
>


-- 
--------------
Greg Lee
Biometrician
Tasmanian Institute of Agricultural Research
New Town Research Laboratories
University of Tasmania
13 St Johns Avenue,
New Town, 7008
Australia
Ph:  +613 6233 6858
Fax: +613 6233 6145

        [[alternative HTML version deleted]]





        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to