Error std::bad_alloc using `terra::as.matrix` on larger SpatRaster
I am looking to run terra::as.matrix
on a somewhat large raster stack (70 gigs). Getting a std::bad_alloc memory error immediately. I see somewhat similar posted questions (e.g., #562 on the terra github repo and elsewhere here), with various potential solutions, but am uncertain which path is most appropriate for my situation. I do not have experience splitting rasters into chunks or sections, and processing each separately. Hoping there’s a way to configure terra for dealing with the issue.