0

I am busy trying to merge 62 DEMs (totaling in 5.6 GB and in GeoTIFF format) in QGIS 3.18 to create a single DEM of southern Africa. The problem was that the tiff I was trying to generate was larger than 4GB. I then quickly googled the problem and found that I needed to force QGIS to create a BigTIFF format. Some articles suggested using compression to keep the file size small, and so I chose the high compression option. I also used the "+" symbol, under advanced parameters, to add "BIGTIFF" as a name and "YES" as a value in order to force the program to create a BigTIFF. The problem is that even after these adjustments the following error still popped up: "ERROR 1: TIFFAppendToStrip:Maximum TIFF file size exceeded. Use BIGTIFF=YES creation option." (more than 1000 apparently). The program then still continues to merge the files with the final file being about 4.2 GB, but only shows black when I view the layer alone in QGIS. Is this normal or did the merge not work properly?

here is the final console command used:

python3 -m gdal_merge -ot Float32 -of GTiff -co COMPRESS=DEFLATE -co PREDICTOR=2 -co ZLEVEL=9 -co BIGTIFF=YES -o "C:/Users/booys/OneDrive/Desktop/UFS/Masters/Micaria (Gnaphosidae) Revision/Micaria photo guide/Maps/World GIS Layers/alt_zaf.tif" --optfile C:/Users/booys/AppData/Local/Temp/processing_YFhkKO/e4f2e3233c764a17b85da2a380aa96fc/mergeInputFiles.txt

Just for background, I am trying to merge these files to create one file that a piece of R code can refer to (from the red package), which relates to the calculation of elevational ranges based on a set of coordinates given.

PS I am very new to QGIS (or GIS systems in general).

UPDATE: I have taken the advice given and created a .vrt file in QGIS using the "Create Virtual Raster" option. I then converted the file to a .tif format using the conversion algorithm in QGIS. After a bunch of hours it successfully converted without any problems. I opened it in QGIS and it takes very long to show anything, but I think it is just because I am using a potato of a laptop.

4
  • I would run it on the command line rather than through QGis to have more control, Also check if R can read in a vrt file to save time mosaicing
    – Ian Turton
    Jul 1 at 11:02
  • The console command looks good but if gdal_merge happens to have some problem with bigtiff you could have a try with gdalbuildvrt. Create first a vrt file with that, and then convert the vrt into GeoTIFF with gdal_translate.
    – user30184
    Jul 1 at 11:10
  • Thank you both. I have placed all the files into one folder and then used the "Build Virtual Raster" option inside QGIS to make a vrt file. I have now started a conversion to GeoTIFF, but I have a feeling it may take a very long time. I will update this post once it has been done. Jul 1 at 13:03
  • Regarding the speed issue in your update: try gis.stackexchange.com/questions/402636/…. Should help if the problem is speed when zoomed out.
    – Houska
    Jul 2 at 12:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.