I'm using the raster package version 0.8.9-17 on R2.9.0. While using the function projectRaster I'm projecting my data and need to output a new ESRI grid (.asc). The following code I think should do the job, but it is writing two different files (.grd and .gri) instead of the .asc I need. Is this a bug?
asc.in.dir<-"C:\\..\\raster.directory" asc.out.dir<-"C:\\...\\raster.directory\\UTMprojected" asc.in.files<-dir(asc.in.dir, pattern='.asc$') r<-raster(paste(asc.in.dir, "\\", asc.in.files[i], sep="")) r[]<-1:ncell(r) projection(r) <- "+proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0" newproj <- "+proj=sinu" projext <- projectExtent(object=r, projs=newproj) projras <- projectRaster(from=r, to=projext, method="ngb", filetype="ascii", filename=paste(asc.out.dir, "\\UTM <file://utm/>", asc.in.files[i], sep="")) Tim [[alternative HTML version deleted]] _______________________________________________ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo