I want to merge 2 large raster files (7Go+8Go7GB+8GB) 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)
Unable to allocate 14.2 GiB for an array with shape (53701, 35412) and data type int64
I already manage to generate a 13Go13GB file with the merge command.
Is 14.2 GoGB an absolute limit (for merging) of the QGIS software ? Is thère another way to merge 2 large raster file ?
(My computer has 8GO8GB RAM + 1To1TB 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)command and data type int64 Le processus a renvoyé le code erreur 1log:
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 <module>
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