geotargets
geotargets copied to clipboard
Suppress `tar_terra_sprc()` warning
Addresses #92 by wrapping the write function in withCallingHandlers()
to capture the uninformative warning [rast] skipped sub-datasets ...
. The warning originates from terra::writeRaster()
when it is used to write a subdataset because the return value of writeRaster()
is rast(<file>)
and that file can't be correctly read by rast()
if it has subdatasets with different projections.
This was difficult to add a test for since warnings from write functions apparently don't bubble up to the output of tar_meta()
. I added a test for a version of the write function instead.