[GRASS-dev] v.rast.stats Python error

Markus Neteler neteler at osgeo.org
Fri Jul 10 10:09:58 EDT 2009


On Fri, Jul 10, 2009 at 3:50 PM, Martin Landa<landa.martin at gmail.com> wrote:
> 2009/7/10 Markus Neteler <neteler at osgeo.org>:
>> Traceback (most recent call last):
>>  File "/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/scripts/v.rast.stats",
>> line 275, in <module>
>>    main()
>>  File "/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/scripts/v.rast.stats",
>> line 164, in main
>>    table = f[1]
>> KeyError: 1
>
> some time ago grass.vector_db() has been changed to return dictionary
> instead of tuple of values. Fixed in r38349.

Thanks, Martin, it now works.

I wonder how this script could be made faster (as often requested by users
including me). I compared the shell script speed in 6.4 to the python script
speed - almost identical, hence it is a design flaw. Since we are using
Python now, is there a way to perform masked raster access in a different
(and faster) way?

Suggestions welcome,
Markus


More information about the grass-dev mailing list