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
As of current HEAD, mosaic() does not write files when filename is present if an sprc has 1 layer.
library(terra)
#> terra 1.7.45x<- rast(xmin=-110, xmax=-60, ymin=40, ymax=70, res=1, vals=1)
y<- rast(xmin=-95, xmax=-45, ymax=60, ymin=30, res=1, vals=2)
z<- rast(xmin=-80, xmax=-30, ymax=50, ymin=20, res=1, vals=3)
# If the sprc has multiple rasters, this works:rsrc<- sprc(list(x, y, z))
out_file<- tempfile(fileext=".tif")
m<- mosaic(rsrc, filename=out_file)
file.exists(out_file)
#> [1] TRUE# If the sprc only has one raster, this fails to write a file:rsrc<- sprc(list(x))
out_file<- tempfile(fileext=".tif")
m<- mosaic(rsrc, filename=out_file)
file.exists(out_file)
#> [1] FALSE
I know this is a weird use for the sprc class, but my use case is in a package that is downloading some unknown-to-me number of tiles and uses terra to combine them into a single output image. The package always routes the downloaded tiles into an sprc, no matter how many of them exist, and as such currently fails when there is only a single tile.
The text was updated successfully, but these errors were encountered:
As of current HEAD,
mosaic()
does not write files whenfilename
is present if an sprc has 1 layer.Created on 2023-09-05 with reprex v2.0.2
Session info
I know this is a weird use for the sprc class, but my use case is in a package that is downloading some unknown-to-me number of tiles and uses terra to combine them into a single output image. The package always routes the downloaded tiles into an sprc, no matter how many of them exist, and as such currently fails when there is only a single tile.
The text was updated successfully, but these errors were encountered: