Luca Delucchi wrote:

> I try to create a general function for v.what, it return a dictionary
> of dictionary

>   # create string for east_north param
>   coor = str(x) + ',' + str(y)

This isn't necessary; you can pass numbers, lists and tuples to the
grass.*_command() functions and they will be converted automatically.

>   fields = grass.read_command('v.what',flags = 'a', map = map, east_north = 
> coor)

I suggest using the -g flag.

>   # split the different features
>   fields = fields.split('\n\n')

This isn't correct. Without -g, the blank line occurs betwen the
Layer: and Category: lines and the rest of the per-layer information. 
You need to scan through the lines and start a new dictionary whenever
you find a "Layer" line.

-- 
Glynn Clements <[email protected]>
_______________________________________________
grass-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-dev

Reply via email to