Dear r-sig-geo,

I plan to reproject from lonlat to UTM for a bunch of 10 meter NED files
(large) using a R script(I did it successfully for the 30 meter DEM), I
used the following code to run:

rasterOptions(chunksize = 1e+10, maxmemory = 1e+12) #need to allow bigger
chunksize for the processing!!!
 #*----Function for detect the UTM Zone-----#
long2UTM <- function(long) {
  (floor((long + 180)/6) %% 60) + 1
}

  require(raster)
  require(rgdal)
  filename <- "grdn41w083_13"
  longitude <- paste("-",substr(filename,9,10),sep="")
  lon <- as.numeric(longitude)
  utm <-paste("+proj=utm +zone=",long2UTM(lon)," +datum=NAD83 +ellps=GRS80
+towgs84=0,0,0 +units=m +no_defs",sep="")
  r  <- raster(filename)
  outputfile <- paste("projected/",substr(filename,4,10),".tif",sep='')
  print(paste(outputfile))
  pr <- projectRaster(r, crs=utm, res=10.0, method='bilinear')

However, the projectRaster takes forever to finish and it almost crashed my
computer.

The file is kind of big  (file size is 455MB),The file information is
class       : RasterLayer
dimensions  : 10812, 10812, 116899344  (nrow, ncol, ncell)
resolution  : 9.259259e-05, 9.259259e-05  (x, y)
extent      : -83.00056, -81.99944, 39.99944, 41.00056  (xmin, xmax, ymin,
ymax)
coord. ref. : +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs
data source : c:\temporary\10M\grdn41w083_13
names       : grdn41w083_13
values      : 212.254, 460.0799  (min, max)

My R information:
sessionInfo()
R version 3.0.1 (2013-05-16)
Platform: x86_64-w64-mingw32/x64 (64-bit)
attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base
other attached packages:
[1] rgdal_0.8-10  raster_2.1-49 sp_1.0-11
loaded via a namespace (and not attached):
[1] grid_3.0.1      lattice_0.20-27 tools_3.0.1

However, this process only took 10 seconds using the existing tool in
ArcGIS toolbox. Has someone experienced this before? Any comments will be
welcome.

Thanks,

Ping

	[[alternative HTML version deleted]]

