报错如下信息:
ERROR 1: TIFFAppendToStrip:Write error at scanline 12760
ERROR 1: TIFFReadEncodedStrip:Read error at scanline 12760; got 0 bytes, expected 676096
ERROR 1: TIFFReadEncodedStrip() failed.
ERROR 1: TIFFReadEncodedStrip() failed.
ERROR 1: D:\26.tif, band 1: IReadBlock failed at X offset 0, Y offset 12901: TIFFReadEncodedStrip() failed.
ERROR 1: _tiffWriteProc:No error
ERROR 1: TIFFAppendToStrip:Write error at scanline 4992
ERROR 1: TIFFResetField:D:\26.tif.ovr: Can not read TIFF directory count
这种写不下tiff的报错是因为影像太大,超过4G了,因此在做GDAL相关处理时,要添加BIGTIFF处理参数,比如加金字塔:
gdaladdo --config BIGTIFF_OVERVIEW YES D:/1.tiff 2 4 8 16 32 64 128
比如镶嵌合并影像:
gdal_merge.bat -ot Byte -of GTiff -o D:/output.tif --optfile C:/mergeInputFiles.txt --config BIGTIFF_OVERVIEW YES
至此,问题解决。