[R-sig-Geo] Creating big raster from small tiles

steven mosher moshersteven at gmail.com
Mon Oct 17 05:54:07 CEST 2011


 I have 72 "tiles" in a tif format and each tile is   30X30

>tile
class       : RasterLayer
dimensions  : 3600, 3600, 12960000  (nrow, ncol, ncell)
resolution  : 0.008333333, 0.008333333  (x, y)
extent      : 60, 90, 60, 90  (xmin, xmax, ymin, ymax)
coord. ref. : NA
values      : C:/Users/steve/....
min value   : 0
max value   : 255

What I'd like to do is find  the fastest way to bring all 72 tiles
into one big raster.

merge() seems like one good choice, where I would   merge each tile
with a blank raster that would get
filled in incrementally by each tile

> world
class       : RasterLayer
dimensions  : 21600, 43200, 933120000  (nrow, ncol, ncell)
resolution  : 0.008333333, 0.008333333  (x, y)
extent      : -180, 180, -90, 90  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +towgs84=0,0,0
values      : none

world <- merge(tile, world)

and the  repeat that for the remaining 71 tiles.  I'm also think that
one could extract the values from the tile
and use setValues  but  that appears to hit the memory wall in
Windows.  The other option
I suppose is to use writeValues()  and create  a big file from the tiles.

Am I missing any obvious options?

Steve



More information about the R-sig-Geo mailing list