Hi All,
I have a folder with approximately 300 large TIFFs, totaling about 30 gb.  I am 
trying to batch crop them by a shapefile (using functions from the raster and 
rgdal packages).  The script below works when I have a small number of TIFFs 
but when I run it with 25 or so TIFFs I get the "Failure during raster IO" 
error when I run crop.  I'm assuming this is because of memory limitations.
Is there any way to crop and save each file individually without putting it all 
in memory as a raster stack?  Or do people have other suggestions? I'm a fairly 
new user of R, so go easy on me. Thanks!
RVP

require(raster)
require(rgdal)
setwd("E:\\Trend Analysis\\LandsatStackFull")
boundary <- readOGR(getwd(), "study_unproj")
tiff.files <- list.files(getwd(),pattern="\\.tif$", full.names=FALSE)
tiff.stack <- stack(tiff.files)
tiff.crop <- crop(tiff.stack, boundary)

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to