Re: [GRASS-dev] problem with parse_command python

2010-12-29 Thread Glynn Clements
Luca Delucchi wrote: > > This isn't correct. Without -g, the blank line occurs betwen the > > Layer: and Category: lines and the rest of the per-layer information. > > I don't know if this is correct, look the answer of "fields = > grass.read_command('v.what',flags = 'a', map = map_tiles, east_

Re: [GRASS-dev] problem with parse_command python

2010-12-29 Thread Martin Landa
Hi, 2010/12/29 Luca Delucchi : [...] take a look at vector_what() introduced in r44767. Martin -- Martin Landa * http://geo.fsv.cvut.cz/~landa ___ grass-dev mailing list grass-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-dev

Re: [GRASS-dev] problem with parse_command python

2010-12-29 Thread Luca Delucchi
2010/12/29 Glynn Clements : >>   # 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. > ok, I change them with a list >>   fields = gra

Re: [GRASS-dev] problem with parse_command python

2010-12-28 Thread Glynn Clements
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

Re: [GRASS-dev] problem with parse_command python

2010-12-27 Thread Luca Delucchi
2010/12/23 Glynn Clements : > Hi Glynn, thanks for the answer > parse_key_val returns a dictionary, so the keys must be unique. If you > have duplicate keys, only the last value will be returned. > > For v.what, you'll need to parse the output yourself. > ok, I understood it > For the future, w

Re: [GRASS-dev] problem with parse_command python

2010-12-23 Thread Glynn Clements
Luca Delucchi wrote: > Hi all, I'm working for a new module using python but I have a strange > problem with parse_command and v.what. When I have a "good dictionary" > (setting parse = (grass.parse_key_val, { 'sep' : ':' })) I can see > only the attributes of one feature, with a "bad dictionary"

[GRASS-dev] problem with parse_command python

2010-12-23 Thread Luca Delucchi
Hi all, I'm working for a new module using python but I have a strange problem with parse_command and v.what. When I have a "good dictionary" (setting parse = (grass.parse_key_val, { 'sep' : ':' })) I can see only the attributes of one feature, with a "bad dictionary" I see all the features but I c