[Qgis-user] error with qgis 1.7 shaded relief plugin

Goyo goyodiaz at gmail.com
Tue Jun 28 13:13:43 PDT 2011


2011/6/28 maning sambale <emmanuel.sambale at gmail.com>:
> [Posting in the list because I can't find the shaded relief plugin
> project in the hub.qgis.org to post an issue]
>
> Using the shaded relief plugin in 1.7 we get the following errors.
>
> An error has occured while executing Python code:
> Traceback (most recent call last):
> File "C:/Users/ariel/.qgis/python/plugins\shadedrelief\ShadedReliefDialog.py",
> line 83, in accept    myEngine.run()
> File "C:/Users/ariel/.qgis/python/plugins\shadedrelief\ShadedReliefEngine.py",
> line 71, in run    gr = numpy.ma.filled(grm, numpy.ma.average(grm))
> File "C:\PROGRA~2\QUANTU~2\apps\Python25\lib\site-packages\numpy\ma\extras.py",
> line 286, in average    d =
> umath.add.reduce((-mask).ravel().astype(int))
>
> MemoryError

I think you just don't have enough memory to perform the operation.
The plugin is implemented for speed and simplicity at the price of
high memory use so it will fail on large rasters.

You can try gdaldem: http://www.gdal.org/gdaldem.html. You'll have to
use the command line since it's not in the qgis raster plugin yet.

I personally feel quite uncomfortable and experiment performance
issues working with large rasters so this is what I do:

- Keep my raster files small. I get almost all my DEMs from a WCS in
1000x1000 px tiles and convert them to 16 bit integers (they are 32
bits float originally but no DEM has so much precision).

- Generate seperate hillshades for each DEM. The shaded relief plugin
is very convenient and has the advantage of generating 128 bit
rasters.

- Avoid loading lots of rasters in a qgis project. Better combine them
using VRT. I use it to combine dozens of DEMs when I need to cover
larger regions in a single project with very good results.

Goyo



More information about the Qgis-user mailing list