Closed sigmafelix closed 4 months ago
From 0.7.3, newly added internal functions detect whether a file path is vector or raster then par_grid
convert SpatVector
grid polygons into sf
right before the future.apply::future_lapply
is run to ensure the objects are exported to parallel workers. The approach still has caveats in file-based databases (i.e., GPKG) that can contain multiple layers either raster or vector. terra::vect
attempts to read the first layer unless layer
argument is specified, which avoids crashing the downstream functions. However, documentation should clearly state potential issues with file-based databases.
plan(multicore)
is available in nix systems (due to the support offork
-eval
). With other thanmulticore
plan,terra
objects are not exportable to parallel workers. `par_functions should utilize
planvalue to convert or to give a warning message when
terra` objects are put in.future::supportsMulticore()
andfuture::plan()
, editpar_*
functions to display a message on nonexportable objectssf
/terra
objects directly