3

I have a set of landuse landcover data which needs to be mosaiced.

Whenever i try using QGIS Raster>miscellenous>merge tool. giving no datavalue as '0', it returns either

(A)

 ' Traceback (most recent call last): 
File "C:\PROGRA~2\QGISVA~1\bin\gdal_merge.py", line 509, in 
sys.exit(main()) 
File "C:\PROGRA~2\QGISVA~1\bin\gdal_merge.py", line 495, in main 
fi.copy_into( t_fh, band, band, nodata ) 
File "C:\PROGRA~2\QGISVA~1\bin\gdal_merge.py", line 241, in copy_into 
nodata_arg ) 
File "C:\PROGRA~2\QGISVA~1\bin\gdal_merge.py", line 61, in raster_copy 
nodata ) 
File "C:\PROGRA~2\QGISVA~1\bin\gdal_merge.py", line 101, in raster_copy_with_nodata 
to_write = Numeric.choose( nodata_test, (data_src, data_dst) ) 
File "C:\PROGRA~2\QGISVA~1\apps\Python27\lib\site-packages\numpy\core\fromnumeric.py", line 296, in choose 
return choose(choices, out=out, mode=mode) 
MemoryError 

or

(B)

' The process crashed sometime after starting successfully'

I am using QGIS 2.2 on Windows 8 PC.

I have a set of 30 images in .tiff format which needs to be mosaiced. I also tried doing it with 2-3 images but the same problem persists.

3 Answers 3

2

You are running into a memory error.

According to this mailing list posts from the developers:

http://lists.maptools.org/pipermail/fwtools/2006-October/000531.html

http://lists.osgeo.org/pipermail/gdal-dev/2010-January/023310.html

you should better use gdalwarp for such purposes.

2
  • If one were trying to use conversion -> rasterize and receive that same error, does that entail the same issue - a memory error? Jul 18, 2016 at 19:09
  • Start with a raster size of 10x10 cells. if that works, but higher resolution fails, you run into a memory error. You might get further using gdal_rasterize on the command line.
    – AndreJ
    Jul 19, 2016 at 6:07
0

If you do not need to have a physical mosaic file, but rather the results of the mosaic, you could use a Virtual Raster (Raster - Misc - Build Virtual Raster). With this tool you can generate a mosaic'd image from rasters, and identify no data values.

2
  • i do need a physical mosaic file. is it possible to save the virtual raster into a physical file?
    – user29483
    Apr 29, 2014 at 9:25
  • A virtual raster is a physical file (.vrt), but it is just a linking file. The virtual raster will be very small in size. Also, if you move the .vrt without the source files, the mosaic will be broken Apr 29, 2014 at 14:04
0

Could it be helpful to go though Raster/Analysis/Fill 'nodata' first, and try to merge after? It allows you to fill the nodata value for an entire folder in batch, for *.bil extensions and others.

(Given my version is in dutch - I'm just translating straightforward.)

Your Answer

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

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