Why transforming .vrt to .tif considerably increases size of raster?

The vrt is a small xml file pointing to existing rasters. When you convert it to a raster, you will write all the information from the input raster in a new file.

The extent of the output file will be the extent of the vrt file, which is by default the extent rectangle that contains all the rectangles of input files. If there are gaps between the input files, there will be more pixels in the resulting raster file, hence it will be larger than the sum of the inputs (even if the pixels are NoData pixels).

By default, converting to raster will not apply any compression to the dataset. For the best possible compression, here are a few tricks :

1) don't use Float32 if not necessary, because the compression rate of Float32 is lower than Byte and Integer, and raw float 32 is larger than Byte and int32. If you multiply your elevation values by 10, you will be able to store your elevation values in integer16 with 10 cm precision, which is usually more than enough.

2) With most geographic data, you can take advantage of the spatial autocorrelation when compressing the data. Use additionnal option PREDICTOR=2 with Int16 and PREDICTOR=3 with Float32 to increase the compression rate.

In practice, with QGIS 3, once you go to the raster > conversion > translate form, you can add creation parameters with the green cross, for instance

enter image description here

Remark: reading a compressed file is slower than reading an uncompressed file, so it is not always a good thing to compress your data.


Your input tifs may be compressed and you are outputting an uncompressed tif. To output a compressed tif, use the Processing Toolbox -> GDAL -> Translate (Convert Format) and specify High compression in the Advanced parameters -> Additional Creation options -> Profile

enter image description here

enter image description here