Skip to content
Prev 25451 / 29559 Next

Bug in raster::canProcessInMemory?

The current code is:

```
function(x, n=4) {

if (.toDisk()) {
return(FALSE)
}
n <- n + nlayers(x) - 1
cells <- round( 1.1 * ncell(x) ) * n

if ( cells > .maxmemory() ) {
return(FALSE)
} else {
return(TRUE)
}
}
```
The line ``n <- n + nlayers(x) - 1`` seems like it should be ``n <- n *
nlayers(x)``.

Better yet, I'd remove that line and change the next to: ``cells <- round(
1.1 * ncell(x) * nlayers(x) ) * n``

Hope this helps,
Kenny