
Dear all,

A very basic terrain calculated as a matrix from Spatial Points Patterns:

#interpolate using the akima package
library(akima)
terrain=interp(ppoints$x,ppoints$y,ppoints$marks,xo=x0,yo=y0, linear=F)

> class(terrain)
[1] "list"
> class(terrain$x) #these are the x-coord i.e: [1...1000]
[1] "numeric"
> class(terrain$y)#these are the y-coord i.e: [1...1000]
[1] "numeric"
> class(terrain$z)#these are the height
[1] "matrix"

I would like to export this "terrain" (list object) to GRASS.
Reading the documentation that I found for interfacing between GRASS 6 and R (library (spgrass6)). I understood the following (I already managed to configured properly the mapset and so on):

1. I have to create a SpatialGridDataFrame object before to write into a Raster file.
2. In order to create a SpatialGridDataFrame I need a GridTopology.
3. After doing it, I am allow to write the file into GRASS using the function writeRAST6, like: writeRAST6 (spterrain, "maps.dem").

How to create the SpatialGridDataFrame and/or the GridTopology? I am doing something wrong.

Thanks,

Javier Hidalgo.
_________________________________________________________________


	[[alternative HTML version deleted]]


