[Qgis-developer] Re: shaded relief plugin python error

Giovanni Manghi giovanni.manghi at gmail.com
Sat Mar 6 08:35:26 EST 2010


Hi Andreas,


> first I thought perhaps the DEM is simply too large to fit into
> memory. The plugin does load the complete DEM into memory, and
> actually needs to maintain additional copies as well for computation.
> 
> However, I could successfully use the plugin with your Portugal DEM
> here on my machine. It is 64bit linux and has 16GB of memory. If you
> want I can upload the shaded relief somewhere. Perhaps you can find
> access to a larger machine as well ?



It seems really a memory problem. I tested both windows and linux with
different memory configurations and as a fact there is a minimum amount
of ram necessary to complete the analysis. Linux seems to perform
slightly better as with 2560mb of ram it completes the task while xp
still fails.

It would be possibile to add in the plugin a control/warning when memory
ends? Otherwise in many cases users will be given a python error that
has a little meaning to them and they will probably give the blame to
the plugin itself.

cheers

-- Giovanni --







> >
> > Andreas
> >
> >
> >
> > On Sun, Feb 28, 2010 at 5:23 PM, Giovanni Manghi
> > <giovanni.manghi at gmail.com> wrote:
> >> Hi all,
> >> I'm getting python error(s) when running the shaded relief plugin on the
> >> following digital terrain model (qgis 1.4 on both linux and windows)
> >>
> >> http://mapserver.uevora.pt/~mapserver/dem_portugal.tif.tar.gz
> >>
> >> here are the errors
> >>
> >> ---------------------------
> >> An error has occured while executing Python code:
> >>
> >> Traceback (most recent call last):
> >>  File
> >> "/home/gio/.qgis//python/plugins/shadedrelief/ShadedReliefDialog.py",
> >> line 82, in accept
> >>    myEngine.run()
> >>  File
> >> "/home/gio/.qgis//python/plugins/shadedrelief/ShadedReliefEngine.py",
> >> line 64, in run
> >>    sta=numpy.dstack((-gr[1]*dy,gr[0]*dx,numpy.ones(gr[0].shape)*dx*dy))
> >>  File "/usr/lib/python2.6/dist-packages/numpy/lib/shape_base.py", line
> >> 573, in dstack
> >>    return _nx.concatenate(map(atleast_3d,tup),2)
> >> MemoryError
> >>
> >> Python version:
> >> 2.6.2 (release26-maint, Apr 19 2009, 02:11:59)
> >> [GCC 4.3.3]
> >> ---------------------------
> >>
> >> An error has occured while executing Python code:
> >>
> >> Traceback (most recent call last):
> >>  File
> >> "/home/gio/.qgis//python/plugins/shadedrelief/ShadedReliefDialog.py",
> >> line 82, in accept
> >>    myEngine.run()
> >>  File
> >> "/home/gio/.qgis//python/plugins/shadedrelief/ShadedReliefEngine.py",
> >> line 57, in run
> >>    gr =
> >> numpy.gradient(numpy.array(rastergdal.layerAsArray(str(self.sourceFileParam)))*self.vzParam)
> >>  File "/usr/lib/python2.6/dist-packages/numpy/lib/function_base.py",
> >> line 1017, in gradient
> >>    out[slice1] = (f[slice2] - f[slice3])/2.0
> >> MemoryError
> >> ---------------------------
> >>
> >>
> >> cheers
> >>
> >> -- Giovanni --



More information about the Qgis-developer mailing list