[R-sig-Geo] Error with disaggregate

Ned Horning horning at amnh.org
Tue Feb 18 18:47:54 CET 2014


Hi -

I am trying calculate the sum of blocks of Landsat pixels (30m 
resolution) that fit within MODIS pixels 960m resolution) and store that 
values at the Landsat cell size. To accomplish that I am running 
aggregate with the "sum" function on a Landsat band and then I run 
disaggregate on the result to get the resolution back to the Landsat 
pixel size. When I do this the disaggregate function gives me the 
following error:
--
Error in writeBin(v, x at file@con, size = x at file@dsize) :   only 2^31-1 
bytes can be written in a single writeBin() call
--

I can recreate the error with this script:
--
a <- raster(nrows=7776, ncols=7616, xmn=718335, xmx=946815, ymn=-757485, 
ymx=-524205, crs="+proj=utm +zone=35 +datum=WGS84 +units=m +no_defs 
+ellps=WGS84 +towgs84=0,0,0")
a[] <- 1
b <- aggregate(a, fact=32, fun=sum)
c <- disaggregate(b, fact=32)
--

I am running R 3.0.2 on Ubuntu 12.04 with version 2.2-12 of the raster 
package.

Please let me know if you see any problems with my code.

Thanks.

Ned



More information about the R-sig-Geo mailing list