[R-sig-Geo] Writing a tif using rgdal

Andy Bunn abunn at whrc.org
Tue Feb 7 16:08:37 CET 2006


Howdy List:

I'm reading in a large number of satellite images and analyzing them in R. I
know how to read a tif into R using rgdal and manipulate it. Is there a good
way to write a new tif out using the projection data from the original?

So in the example below how can I write out z as a jpg using the metadata
and such from x?

-Andy


library(rgdal)
logo <- system.file("pictures/Rlogo.jpg", package="rgdal")[1]
x <- new("GDALReadOnlyDataset", logo)
displayDataset(x)
y <- getRasterData(x)
z <- rowMeans(y, dims=2)
dim(z)

> version
         _
platform i386-pc-mingw32
arch     i386
os       mingw32
system   i386, mingw32
status
major    2
minor    2.0
year     2005
month    10
day      06
svn rev  35749
language R




More information about the R-sig-Geo mailing list