Skip to main content
1 of 2

QGIS - Memory Error when merging large raster file

I want to merge 2 large raster files (7Go+8Go) I got error messages, with a final "Unable to allocate 14.2 GiB for an array with shape (53701, 35412) and data type int64" (see below)

I already manage to generate a 13Go file with the merge command.

Is 14.2 Go an absolute limit (for merging) of the QGIS software ? Is thère another way to merge 2 large raster file ?

(My computer has 8GO RAM + 1To Disk)

Commande GDAL : gdal_merge.bat -a_nodata 0.0 -ot Float32 -of GTiff -o "C:/Users/Asus/Desktop/FALL test.tif" --optfile C:/Users/Asus/AppData/Local/Temp/processing_PdBtfS/4ffcc760e4124a3f9c847586ff134e2e/mergeInputFiles.txt Sortie de commande GDAL : Traceback (most recent call last): File "C:\PROGRA~1\QGIS34~1.2\apps\Python312\Scripts\gdal_merge.py", line 12, in sys.exit(main(sys.argv)) ^^^^^^^^^^^^^^ File "C:\PROGRA~1\QGIS34~1.2\apps\Python312\Lib\site-packages\osgeo_utils\gdal_merge.py", line 657, in main return gdal_merge(argv) ^^^^^^^^^^^^^^^^ File "C:\PROGRA~1\QGIS34~1.2\apps\Python312\Lib\site-packages\osgeo_utils\gdal_merge.py", line 397, in gdal_merge return _gdal_merge(argv=argv) ^^^^^^^^^^^^^^^^^^^^^^ File "C:\PROGRA~1\QGIS34~1.2\apps\Python312\Lib\site-packages\osgeo_utils\gdal_merge.py", line 642, in _gdal_merge fi.copy_into(t_fh, band, band, nodata, verbose) File "C:\PROGRA~1\QGIS34~1.2\apps\Python312\Lib\site-packages\osgeo_utils\gdal_merge.py", line 348, in copy_into return raster_copy( ^^^^^^^^^^^^ File "C:\PROGRA~1\QGIS34~1.2\apps\Python312\Lib\site-packages\osgeo_utils\gdal_merge.py", line 95, in raster_copy return raster_copy_with_mask( ^^^^^^^^^^^^^^^^^^^^^^ File "C:\PROGRA~1\QGIS34~1.2\apps\Python312\Lib\site-packages\osgeo_utils\gdal_merge.py", line 190, in raster_copy_with_mask to_write = np.choose(mask_test, (data_src, data_dst)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\PROGRA~1\QGIS34~1.2\apps\Python312\Lib\site-packages\numpy\core\fromnumeric.py", line 416, in choose return _wrapfunc(a, 'choose', choices, out=out, mode=mode) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\PROGRA~1\QGIS34~1.2\apps\Python312\Lib\site-packages\numpy\core\fromnumeric.py", line 59, in _wrapfunc return bound(*args, **kwds) ^^^^^^^^^^^^^^^^^^^^ numpy.core._exceptions._ArrayMemoryError: Unable to allocate 14.2 GiB for an array with shape (53701, 35412) and data type int64 Le processus a renvoyé le code erreur 1