Open HassanMasoomi opened 11 months ago
I see
file.info("all_terra.tif")$size / 1024^2
#[1] 901.186
file.info("all_terra_rewrite.tif")$size / 1024^2
#[1] 261.0031
describe("all_terra.tif")[c(37, 45)]
#[1] " COMPRESSION=LZW"
#[2] "Band 1 Block=1100x1 Type=Float32, ColorInterp=Gray"
describe("all_terra_rewrite.tif")[c(37, 45)]
#[1] " COMPRESSION=LZW"
#[2] "Band 1 Block=1100x1 Type=Float32, ColorInterp=Gray"
It seems that the compression is not working very well when using merge
the way that terra implements it.
Hi,
I have several tiles and I need to merge them; but using terra's
merge
function will result in a ridiculously huge output file while using raster'smerge
function behaves very well and the output makes sense. In my real case, the output should be around 7GB but when I use terra'smerge
function, it results in an output file of ~120GB!!!I managed to provide a reproducible example here. In this example, I have 80 tiles of ~6.5MB (in total ~520MB). Using terra, the merged file is ~4GB (!!!) while using raster results in a merged file of ~850MB (which is what expected).
Interestingly, if I just rewrite the result from terra, it will be ~850MB which totally would makes sense.