2

I need to merge two TIFFs into one, but the output is larger than 4 GB. So, it needs to be a BigTIFF. But the "BIGTIFF=YES" creation option seems to be ignored. Here's the error:

$ gdal_merge.py -separate -co "BIGTIFF=YES" -co "COMPRESS=DEFLATE" -o merged.tif vv.tif vh.tif
0...10...20...30...40...50ERROR 1: ZIPDecode:ZLib error:
ERROR 1: TIFFReadEncodedStrip() failed.
ERROR 1: merged.tif, band 1: An error occurred while writing a dirty block from GDALRasterBand::RasterIO
...60...70...80...90...100 - done.
ERROR 1: TIFFAppendToStrip:Maximum TIFF file size exceeded. Use BIGTIFF=YES creation option.
ERROR 1: ZIPDecode:ZLib error:
ERROR 1: TIFFReadEncodedStrip() failed.

The output TIFF (which is corrupted) is 4.3 GB whereas the two TIFFs I want to merge are both 1.5 GB.

I also tried without the compression option, but the result is the same. Any idea where this comes from?

4
  • 1
    what is your version of GDAL ? I had some issues with 2.3. Also, as a workaround, tou should try "gdalbuildvrt -separate merged.vrt vv.tif vh.tif" then "gdal_translate merged.vrt merged.tif -co BIGTIFF=YES -co COMPRESS=DEFLATE" (I also recommend -co TILED=YES). Finally, consider that working with the vrt is often a good solution in itself (no need to build new tif)
    – radouxju
    Commented Jan 3, 2019 at 8:58
  • 1
    Remove the double quotes and try again.
    – user30184
    Commented Jan 3, 2019 at 9:26
  • @radouxju I have version 2.4. Indeed, doing what you suggest works fine!
    – mckbrd
    Commented Jan 3, 2019 at 9:43
  • @user30184 already tried, it doesn't change anything.
    – mckbrd
    Commented Jan 3, 2019 at 9:44

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.