[R-sig-Geo] Converting array into raster brick

christian.kamenik at giub.unibe.ch christian.kamenik at giub.unibe.ch
Thu Dec 16 21:26:15 CET 2010

Dear all,

I needed to convert an array into a RasterBrick object. The output did  
not need to be written to memory, as assessed by canProcessInMemory().  
The only way to put the data into the RasterBrick that worked for me  
was layer by layer:

for (l in 1:nlayers(x)) x <-setValues(x,values=as.vector(t(xx[,,l])),layer=l)

This was quite complicated and slow. So I am wondering if there is a  
better way of doing this.

Many thanks, Christian

More information about the R-sig-Geo mailing list