[STATSGRASS] spatstat to grass

Roger Bivand Roger.Bivand at nhh.no
Sun Jan 14 16:27:57 EST 2007


On Fri, 5 Jan 2007, Jarek Jasiewicz wrote:

> Hi
> My new problem: how to simply convert obiect of class im (spatstat) to 
> SpatialGridDataFrame (sp) to put it to grass.
> I found im maptools packages as.ppp function to convert spatial sp obiects to 
> spatstat (ppp) and now I'm looking for function to convert it back. 
> It seems that I know how to do manualy (little works), but If there is 
> something tool do to it autoimaticaly, I will be welcome

Thanks for an interesting question. For SpatialGridDataFrame to im, these 
work, and can be packaged:

library(maptools)
library(spatstat)
x <- readAsciiGrid(system.file("grids/test.ag", package="maptools")[1])
image(x)
xi <- sp:::as.image.SpatialGridDataFrame(x)
im_x <- im(t(xi$z), xcol=xi$x, yrow=xi$y)
plot(im_x)

and I'm working on the reverse wrapper.

Sorry not to have replied sooner - if you have ideas please share them.

Best wishes,

Roger

> 
> Jarek
> 
> _______________________________________________
> statsgrass mailing list
> statsgrass at grass.itc.it
> http://grass.itc.it/mailman/listinfo/statsgrass
> 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no




More information about the grass-stats mailing list