isciences / exactextractr

R package for fast and accurate raster zonal statistics
https://isciences.gitlab.io/exactextractr/
272 stars 26 forks source link

Notify user if terra should be used? #63

Closed dbaston closed 2 years ago

dbaston commented 2 years ago

In some cases, extracting from a terra SpatRaster is much faster than a RasterStack or RasterLayer, e.g. https://github.com/isciences/exactextractr/issues/58#issuecomment-934614672 . Sometimes the difference is more dramatic. Sometimes there is no difference. I imagine the difference has to do with file type (whether raster is using gdal or ncdf4) the number of layers, and possibly the file chunk size.

Should exactextractr try to identify cases where there is a benefit and provide the user with a notice? Or just issue a general recommendation to always use terra?

dbaston commented 2 years ago

A message is now emitted when extracting from a RasterStack that cannot be eagerly loaded into memory.