[GRASS-user] Re: map query tool in svn

Shane Litherland litherland-farm at bigpond.com
Sat Jan 28 01:27:08 EST 2012


Hi Martin and mailing list,

corresponded awhile back regarding query tool giving error message when
used on vector/s that had connections to different tables on two or
three layers and/or had multiple cats on a layer.

I have used the tool again, now in 6.4 svn updated today (ver50505)
with debug=5 output in the terminal.

I can click on a vector item (e.g. centroid) with multiple connections
and in the terminal the output appears to show the data for each of the
cats on whatever layer they are. It is only towards the end of the
process that I see error messages, seeming to relate to python
commands/modules?? and nothing appears in the GRASS gui area (e.g.
dialog box showing data retrieved from tables).

I was going to try and repeat this in the north carolina dataset... so
the output was more meaningful than referring to my own tables etc...
there's quite a few vectors in NC, can anyone suggest one that has more
than one table connection existing, to save me the time of going through
each vector looking up database connection specifics? It seems most or
all of them have their own dbf file, but are any connected to multiple
tables?

If not, are there any particular vectors/tables that someone would like
me to use from the NC dataset to test/repeat this issue?

regards,
shane.


On Fri, 2011-10-21 at 12:27 +1000, Shane Litherland wrote:
> Hi Martin,
> thanks for confirmation on query tool operation :-)
> 
> Further on the other issue (below):
> > > A problem I find, is that some things I click on don't give results, I
> > > get this sort of error:
> > >
> > > Traceback (most recent call last):
> > >  File "/usr/grass-6.4.2RC1/etc/wxpython/gui_modules/mapdisp
> > > _window.py", line 1017, in MouseActions
> > >
> > > self.OnLeftUp(event)
> > >  File "/usr/grass-6.4.2RC1/etc/wxpython/gui_modules/mapdisp
> > > _window.py", line 1207, in OnLeftUp
> > >
> > > self.parent.QueryVector(self.mouse['begin'][0],
> > > self.mouse['begin'][1])
> > >  File
> > > "/usr/grass-6.4.2RC1/etc/wxpython/gui_modules/mapdisp.py",
> > > line 1382, in QueryVector
> > >
> > > action = mode)
> > >  File "/usr/grass-6.4.2RC1/etc/wxpython/gui_modules/dbm_dia
> > > logs.py", line 104, in __init__
> > >
> > > self.UpdateDialog(query = query, cats = cats)
> > >  File "/usr/grass-6.4.2RC1/etc/wxpython/gui_modules/dbm_dia
> > > logs.py", line 362, in UpdateDialog
> > >
> > > query[1])
> > >  File
> > > "/usr/grass-6.4.2RC1/etc/wxpython/gui_modules/dbm_base.py",
> > > line 109, in SelectByPoint
> > >
> > > if self.tables[table][key]['ctype'] != types.StringType:
> > > KeyError
> > > :
> > > 'grthrs_pax'
> > >
> > > ...........
> > > I get similar message with different last line for different vectors I
> > > query, but it seems to be having an issue with certain columns from
> > > connected tables? for one vector as above, it is the last column of the
> > > table connected on layer 3. column is "character varying(20)"
> > >
> > > On another vector, I get similar message and it is the last column of
> > > the table connected on layer 2, format "integer"
> > >
> > > Yet I can go to another vector, that has "integer" "double precision"
> > > and "character" and the edit dialog box will pop up when I click on the
> > > map.
> > 
> > could you send `v.db.connect -g` and `v.info -c` output for
> > problematic sample vector map?
> > 
> > Martin
> > 
> Here's output from a vector that query tool did work on:
> v.db.connect -g
> map=VIP_transects at Lacebark                                      
> 1 public.VIP_transects cat gisdb pg
> 
> v.info -c
> map=VIP_transects at Lacebark                                            
> INTEGER|cat
> INTEGER|vip
> INTEGER|transect
> DOUBLE PRECISION|startx
> DOUBLE PRECISION|starty
> DOUBLE PRECISION|endx
> DOUBLE PRECISION|endy
> CHARACTER|notes
> Displaying column types/names for database connection of layer 1:
> 
> Below is output for a vector that it gave error on, but whilst I was
> checking this problem, I found that the query tool did work for a couple
> of centroids that ONLY had data in a connection with table one (happens
> to be vectors I am still updating info for other layers) So that may
> help narrow down the possibilities i.e. it may not be the entire vector
> that causes error, but maybe only when querying something which should
> return info for >1 table connections.
> 
> Note I also have multiple entries within each layer for a given
> centroid, I don't think I can confirm if that is or isn't an issue
> whilst the current error stops me from getting any query result for such
> attributes.
> 
> v.db.connect -g
> map=GRT10_11 at Lacebark                                           
> 1 GRT_prevalence cat gisdb pg
> 2 chemical_use cat gisdb pg
> 3 grt_hours cat gisdb pg
> 
> v.info -c
> map=GRT10_11 at Lacebark                                                 
> INTEGER|cat
> DATE|grt_date
> INTEGER|plant_rank
> INTEGER|seed_rank
> CHARACTER|treatment
> CHARACTER|notes
> DOUBLE PRECISION|grt_score
> CHARACTER|grassrgb
> Displaying column types/names for database connection of layer 1:
> 
> v.info -c map=GRT10_11 at Lacebark
> layer=2                                         
> INTEGER|cat
> DATE|chem_date
> CHARACTER|chemical
> DOUBLE PRECISION|chem_vol
> CHARACTER|additives
> DOUBLE PRECISION|mix_vol
> CHARACTER|method
> CHARACTER|area
> CHARACTER|target
> DOUBLE PRECISION|hours
> CHARACTER|chem_notes
> INTEGER|chem_conc
> Displaying column types/names for database connection of layer 2:
> 
> v.info -c map=GRT10_11 at Lacebark
> layer=3                                         
> INTEGER|cat
> DATE|grthrs_date
> DOUBLE PRECISION|grt_hrs
> CHARACTER|grthrs_notes
> CHARACTER|grthrs_pax
> Displaying column types/names for database connection of layer 3:
> 
> 
> Let me know if any more sleuthing required at this end :-)
> 
> -shane
> 
> 
> 




More information about the grass-user mailing list