[R-sig-Geo] Brick and Stack in package raster

Agustin Lobo alobolistas at gmail.com
Fri Nov 26 11:25:16 CET 2010


Robert,

At some point you made this comment:

>>> (as you are dealing with large
>>> files, I think it is more efficient to first make a stack and then
>>> write the results to a brick)

But I have some doubts:

bN = brick(N1,N2,N3,...,N72)
where
N1 = raster(paste(midir,"NDV_19990101__Extract.img",sep="")) etc
takes a very long time. Is a file on disk being written somewhere?

Is overlay() going to be any faster with brick than with stack objects? ie:
bNv2 <- overlay(bN, bSM,
fun=fun1,filename="bNv2.tif",overwrite=TRUE,NAflag=0) faster than
sNv2 <- overlay(sN, sSM, fun=fun1,filename="sNv2.tif",overwrite=TRUE,NAflag=0) ?
(bN, bSM, brick objects; sN, sSM, stack objects)

When you write a brick to a file, can you control if the resulting
file is going to be BSQ or BIL?

Are the files written by writeRaster() identical for stack and brick objects?
writeRaster(bNv2,
filename="bNv2b.tif",overwrite=TRUE,format="GTiff",datatype='INT2U',NAflag=0)
writeRaster(sNv2,
filename="sNv2b.tif",overwrite=TRUE,format="GTiff",datatype='INT2U',NAflag=0)

Thanks

Agus



More information about the R-sig-Geo mailing list