geotargets icon indicating copy to clipboard operation
geotargets copied to clipboard

Suppress `tar_terra_sprc()` warning

Open Aariq opened this issue 4 months ago • 1 comments

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.

Aariq avatar Oct 09 '24 00:10 Aariq