Bug in raster::canProcessInMemory?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Bug in raster::canProcessInMemory?

Kenny Bell
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

--
Kendon Bell
Email: [hidden email]
Phone: (510) 612-3375

Ph.D. Candidate
Department of Agricultural & Resource Economics
University of California, Berkeley

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Loading...