[R-sig-Geo] Error in .GDALnodatavalue(dataformat)

Ned Horning horning at amnh.org
Wed Feb 23 04:20:33 CET 2011


Hi -

I am getting the following error when I run aggregate (from the raster 
package) on a raster image and output to a file.

Error in .GDALnodatavalue(dataformat) : cannot find matching nodata value

This is the command I am running:
aggregate(inImg, fact=40, fun=varPercent, filename=outImage, 
format="GTiff", datatype="INT1U", overwrite=TRUE, progress='text')

If I run this without the datatype="INT1U" it appears to work.

When I run NAvalue the result is 255. I set NAvalue to 0 but the error 
still appears. The integer data I am outputting range from 0 - 100.

This is the function I am calling from aggregate:
--
varPercent <- function(a,...) {
    x <- round(sum(a==11)/1600*100)
    return(x)
}
--

I just updated all of my packages in R today. Although I didn't try this 
script before updating I did try it on another computer that has not 
been updated for quite some time and it works fine.

Any ideas what I'm doing wrong?

Ned



More information about the R-sig-Geo mailing list