I get this error message when I use the caribouMetrics package with pfocal for the ROF dataset
Error: memory exhausted (limit reached?)
I assume this is because pfocal converts the raster to a matrix before passing it to the C++ code. The raster package has a way to handle this using canProcessInMemory to decide when to process the raster in blocks. It is a bit complicated for focal because you need overlapping blocks but raster::focal does it like this:
https://github.com/rspatial/raster/blob/6860faa17fd2f1e8b8b54b2a1bf5074930ff3795/R/focal.R#L125
I have found before that canProcessInMemory is quite conservative about what can be processed by default so you would want to be sure it was only triggered when actually necessary.
Would it be worth while to have something similar for pfocal?
I get this error message when I use the caribouMetrics package with pfocal for the ROF dataset
Error: memory exhausted (limit reached?)
I assume this is because pfocal converts the raster to a matrix before passing it to the C++ code. The raster package has a way to handle this using
canProcessInMemoryto decide when to process the raster in blocks. It is a bit complicated for focal because you need overlapping blocks butraster::focaldoes it like this:https://github.com/rspatial/raster/blob/6860faa17fd2f1e8b8b54b2a1bf5074930ff3795/R/focal.R#L125
I have found before that
canProcessInMemoryis quite conservative about what can be processed by default so you would want to be sure it was only triggered when actually necessary.Would it be worth while to have something similar for pfocal?