id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc 5311,Aggregation (used in the average resampling algorithm) probably uses pixels outside the aggregation blocs,etiennebr,etourigny,"It seems like the gdal aggregation computes the aggregation statistics on pixels outside of the aggregation blocs. Note that the lower right cells values were identical in all dimensions I've tried (about 4 - 10). As a comparison, R seems to be doing it fine. I hypothesize the issue isn't obvious on images because the values are autocorrelated so the artifact is consistent and thus does not appear the the eye. There's a discussion at http://lists.osgeo.org/pipermail/gdal-dev/2013-December/037644.html The example is run with GDAL 1.11dev, released 2013/04/13 {{{ # in R: # might need install.packages(""raster"") require(raster) filei <- '10by10.tif' fileo <- '5by5.tif' dm = 4 r <- raster(matrix(1:(dm^2), dm, dm)) writeRaster(r, filename=filei, overwrite = TRUE) ## aggregate using R aggregate function using the mean r1 <- aggregate(r, fact=2, fun = mean, na.rm = TRUE) file.remove(fileo) cmd <- paste(""gdalwarp -r average -tr"", paste(res(r1), collapse = "" ""), filei, fileo) system(cmd) r2 <- raster(fileo) >as.matrix(r) [,1] [,2] [,3] [,4] [1,] 1 5 9 13 [2,] 2 6 10 14 [3,] 3 7 11 15 [4,] 4 8 12 16 > lapply(list(r1, r2, r2-r1), as.matrix) [[1]] [,1] [,2] [1,] 3.5 11.5 [2,] 5.5 13.5 [[2]] [,1] [,2] [1,] 6.0 12.0 [2,] 7.5 13.5 [[3]] [,1] [,2] [1,] 2.5 0.5 [2,] 2.0 0.0 }}} ",defect,closed,normal,,Algorithms,svn-trunk,normal,fixed,"aggregation, average, mode, resampling",