Skip to content
Prev 11020 / 29559 Next

R array to TIF

Greetings!

I'm reading in a bunch of TIF images that all have the same extent
using rgdal::readGDAL, and then aggregating the stack of $band1 data
by applying a function to the vector of image data at each pixel.  The
result is an R array.  I want to write out this array as a TIF image
with the same parameters (rows, columns, bounding box, projection,
etc.), but I haven't found the trick to creating a
SpatialGridDataFrame so I can use writeGDAL.  I'm also curious about
how one might change the data type (Byte, Int16, etc.) and nodata
value when dumping it out.

Thanks!

Chris