2

I recently installed QGIS 2.14 LTR and I am seeing what it can do. I have repeatedly tried to merge 2 rasters (USGS 1/3 arc second DEM's) in both an ESRI grid format and a GeoTIFF format and each time Merge fails. Here are the diagnostics:

gdal_merge.bat -of GTiff -o C:/Users/Steve/Documents/QGIS/Projects/Garmin/Data/GDD/grdn40-41w106.tif C:\Users\Steve\Documents\QGIS\Projects\Garmin\Data\GDD\grdn40w106.tif C:\Users\Steve\Documents\QGIS\Projects\Garmin\Data\GDD\grdn41w106.tif

Traceback (most recent call last): 
File "C:\PROGRA~2\QGIS2~1.14\bin\gdal_merge.py", line 540, in 
sys.exit(main()) 
File "C:\PROGRA~2\QGIS2~1.14\bin\gdal_merge.py", line 526, in main 
fi.copy_into( t_fh, band, band, nodata ) 
File "C:\PROGRA~2\QGIS2~1.14\bin\gdal_merge.py", line 270, in copy_into 
nodata_arg ) 
File "C:\PROGRA~2\QGIS2~1.14\bin\gdal_merge.py", line 77, in raster_copy 
m_band ) 
File "C:\PROGRA~2\QGIS2~1.14\bin\gdal_merge.py", line 128, in raster_copy_with_mask 
data_dst = t_band.ReadAsArray( t_xoff, t_yoff, t_xsize, t_ysize ) 
File "C:\PROGRA~2\QGIS2~1.14\apps\Python27\lib\site-packages\osgeo\gdal.py", line 2320, in ReadAsArray 
callback_data = callback_data) 
File "C:\PROGRA~2\QGIS2~1.14\apps\Python27\lib\site-packages\osgeo\gdal_array.py", line 330, in BandReadAsArray 
buf_obj = numpy.empty([buf_ysize,buf_xsize], dtype = typecode) 
MemoryError 

AND using ESRI grids:

gdal_merge.bat -of GTiff -o C:/Users/Steve/Documents/QGIS/Projects/Garmin/Data/GDD/grdn40-41w106.tif C:\Users\Steve\Documents\DataGIS\USGS\DEM_1_3as\n40w106\grdn40w106_13\w001001.adF  C:\Users\Steve\Documents\DataGIS\USGS\DEM_1_3as\n41w106\grdn41w106_13\w001001.adf

Traceback (most recent call last): 
File "C:\PROGRA~2\QGIS2~1.14\bin\gdal_merge.py", line 540, in 
sys.exit(main()) 
File "C:\PROGRA~2\QGIS2~1.14\bin\gdal_merge.py", line 526, in main 
fi.copy_into( t_fh, band, band, nodata ) 
File "C:\PROGRA~2\QGIS2~1.14\bin\gdal_merge.py", line 270, in copy_into 
nodata_arg ) 
File "C:\PROGRA~2\QGIS2~1.14\bin\gdal_merge.py", line 77, in raster_copy 
m_band ) 
File "C:\PROGRA~2\QGIS2~1.14\bin\gdal_merge.py", line 128, in raster_copy_with_mask 
data_dst = t_band.ReadAsArray( t_xoff, t_yoff, t_xsize, t_ysize ) 
File "C:\PROGRA~2\QGIS2~1.14\apps\Python27\lib\site-packages\osgeo\gdal.py", line 2320, in ReadAsArray 
callback_data = callback_data) 
File "C:\PROGRA~2\QGIS2~1.14\apps\Python27\lib\site-packages\osgeo\gdal_array.py", line 330, in BandReadAsArray 
buf_obj = numpy.empty([buf_ysize,buf_xsize], dtype = typecode) 
MemoryError 

Other GDAL algorithms (hillshade, contour) that I tried work OK but QGIS does not seem able to merge 2 rasters.

  • how big are the input files? it looks like it's running out of memory – Ian Turton Jun 11 '17 at 10:14
  • 2 x 446 MB GeoTIFFs. Note my answer below, that by installing QGIS 2.18.9 64 bit merge rasters is working OK now. I am feeling better about QGIS now as I have moved a few more steps forward. – Steve Haymes Jun 11 '17 at 20:49
1

By installing QGIS 2.18.9 64 bit Merge is now working.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.