Bug report #15281

Raster calculator crashes unexpectedly with moderate sized TIFs

Added by belg4mit - almost 8 years ago. Updated almost 8 years ago.

Category:Raster Calculator
Affected QGIS version:2.16.0 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:duplicate
Crashes QGIS or corrupts data:No Copied to github as #:23216


I would have thought these were large files, but after seeing #13336 I guess not. I have 4GB and 5GB TIFFs on Windows 7 and I'm trying to do:


and QGIS immediately crashes without warning after I click OK. (I actually want to OR in a third file, but have been waiting 16 hours for the Attribute Table editor to delete multiple columns from a 490Mb DBF before I can prepare it)

The rasters were created with:

gdal_rasterize.exe -burn 40 -tr 10.0 10.0 CENSUS2010TIGERROADS_ARC.shp -l CENSUS2010TIGERROADS_ARC TIGER.tif
gdal_rasterize.exe -burn 1000000000 -tr 10.0 10.0 HYDRO25K_POLY.shp -l HYDRO25K_POLY HYDRO.tif

The source files are available from:

P.S. I also tried to use gdal_calc as a work around without success

gdal_calc.bat -A TIGER.tif -B HYDRO.tif --outfile=CostPath.tif --calc="A|B" 
ImportError: No module named site

RasterCalculatorCrash.zip (4.11 MB) belg4mit -, 2016-07-14 08:08 AM

RasterCalculatorCrash-matching_extent.zip - Crash after running clipper (4.14 MB) belg4mit -, 2016-07-14 09:13 AM


#1 Updated by belg4mit - almost 8 years ago

Sorry, I forgot to include the minidump.

#2 Updated by belg4mit - almost 8 years ago

Got gdal_calc.py working after using out that I had to run OSGeo4W.bat first.

I get the following:

Error! Dimensions of file HYDRO.tif (33592, 23330) are different from other files (29593, 18206). Cannot proceed

#3 Updated by belg4mit - almost 8 years ago

I clipped the rasters to be the same size/extent, although that really should not be necessary, and it still crashes.

#4 Updated by Giovanni Manghi almost 8 years ago

  • Resolution set to duplicate
  • Status changed from Open to Closed

seems that #13336 is still valid. I confirm on a clean 2.16 installation on linux.

The gdal raster calculator issue must be reported in the gdal bug tracker.

Also available in: Atom PDF