You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gcs_upload(ndvi, name = "raster.tif", object_function = f, predefinedAcl = "bucketLevel")
Error:
Warning message in class(file) <- c("gcs_cf", class(file)):
“Setting class(x) to multiple strings ("gcs_cf", "RasterBrick", ...); result will no longer be an S4 object”.
The text was updated successfully, but these errors were encountered:
Hmm the issue here is that I assume the nvdi object is S3 compatible, whereas the raster object is S4. A workaround is to write the object to a file yourself and pass in the file name. A longer term solution is to handle S4 objects in the function.
MarkEdmondson1234
changed the title
gcs_upload - object raster
gcs_upload - object raster - S4 objects not supported by gcs_upload
Jun 8, 2022
Usecase:
I am trying to save a raster object as a .tif file in gcs, with these lines of code:
f <- function(input, output){
raster::writeRaster(input, filename = output, format="GTiff", overwrite=TRUE)
}
gcs_upload(ndvi, name = "raster.tif", object_function = f, predefinedAcl = "bucketLevel")
Error:
Warning message in class(file) <- c("gcs_cf", class(file)):
“Setting class(x) to multiple strings ("gcs_cf", "RasterBrick", ...); result will no longer be an S4 object”.
The text was updated successfully, but these errors were encountered: