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

Andreas Plesch andreasplesch at netscape.net
Mon Mar 1 09:58:21 EST 2010


Hello Giovanni,

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 ?

Andreas


On Mon, Mar 1, 2010 at 9:57 AM, Andreas Plesch
<andreas_plesch at harvard.edu> wrote:
> Hello Giovanni,
>
> 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 ?
>
> 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 --
>>
>>
>
>
>
> --
> Andreas Plesch
> 20 Oxford St.
> Cambridge, MA 02138
> Tel: 617-495-2356
> Fax:617-495-7660
>



-- 
Andreas Plesch
20 Oxford St.
Cambridge, MA 02138
Tel: 617-495-2356
Fax:617-495-7660


More information about the Qgis-developer mailing list