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

Alister Hood alister.hood at synergine.com
Tue Jun 28 15:19:30 PDT 2011


Hi guys,

> Date: Tue, 28 Jun 2011 22:13:43 +0200
> From: Goyo <goyodiaz at gmail.com>
> Subject: Re: [Qgis-user] error with qgis 1.7 shaded relief plugin
> To: maning sambale <emmanuel.sambale at gmail.com>
> Cc: qgis-user <qgis-user at lists.osgeo.org>
> Message-ID: <BANLkTikB7c_PawBGsTkdNtZMueMZxgU-Hg at mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
> 
> 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.

Actually, it should be in the raster plugin now - it is on my machine :)

> 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

I get a similar looking error with the shaded relief plugin (in Trunk):

Traceback (most recent call last):
  File "C:/Documents and Settings/alister.hood/.qgis/python/plugins\shadedrelief\ShadedReliefDialog.py", line 83, in accept
    myEngine.run()
  File "C:/Documents and Settings/alister.hood/.qgis/python/plugins\shadedrelief\ShadedReliefEngine.py", line 74, in run
    gr = numpy.gradient(gr*self.vzParam)
  File "C:\OSGeo4W\apps\Python25\lib\site-packages\numpy\lib\function_base.py", line 700, in gradient
    out[slice1] = (f[slice2] - f[slice3])/2.0
MemoryError

Do you also think this is because I don't have enough RAM?  I have 4GB ram and the DEM is only 8MB...


Alister




More information about the Qgis-user mailing list