Opened 13 years ago

Closed 12 years ago

#1522 closed defect (fixed)

dbm_base.py fails with multilayer maps

Reported by: artegion Owned by: grass-dev@…
Priority: critical Milestone: 6.4.2
Component: wxGUI Version: 6.4.2 RCs
Keywords: vector_what Cc:
CPU: All Platform: All

Description (last modified by hamish)

map 'test' has two layers

Layer=1 Category=20 Table=net_table
Layer=2 Category=8  Table=links
Traceback (most recent call last):
  File "c:/osgeo4w/usr/src/grass-6.4.2RC2/dist.i686-pc-
mingw32/etc/wxpython/gui_modules/mapdisp_window.py", line
1017, in MouseActions
  File "c:/osgeo4w/usr/src/grass-6.4.2RC2/dist.i686-pc-
mingw32/etc/wxpython/gui_modules/mapdisp_window.py", line
1207, in OnLeftUp
  File "c:/osgeo4w/usr/src/grass-6.4.2RC2/dist.i686-pc-
mingw32/etc/wxpython/gui_modules/mapdisp.py", line 1382, in
QueryVector
  File "c:/osgeo4w/usr/src/grass-6.4.2RC2/dist.i686-pc-
mingw32/etc/wxpython/gui_modules/dbm_dialogs.py", line 102,
in __init__
  File "c:/osgeo4w/usr/src/grass-6.4.2RC2/dist.i686-pc-
mingw32/etc/wxpython/gui_modules/dbm_dialogs.py", line 360,
in UpdateDialog
  File
"C:\Programmi\Grass\etc\wxpython\gui_modules\dbm_base.py",
line 109, in SelectByPoint

if self.tables[table][key]['ctype'] != types.StringType:
KeyError
:
'STATUS'

v.what works fine

>> ret = grass.read_command('v.what',
                       quiet      = True,
                       flags      = 'ag',
                       map        = 'test',
                       east_north = '60.0,70.0',
                       distance   = '1.0')
>> ret
East=60
North=70
Map=test
Mapset=piacenza
Type=Line

Id=20
Length=20.000000
Layer=1
Category=20
Driver=sqlite
Database=d:\gis_db\gauss-boaga\test_sqlite.db
Table=net_table
Key_column=cat
cat=20
net=
Layer=2
Category=8
Driver=sqlite
Database=d:\gis_db\gauss-boaga\test_sqlite.db
Table=links
Key_column=cat
cat=8
ID=12
LTYPE=1
NODE1=12
NODE2=13
LENGTH=5280
DIAMETER=10
ROUGHNESS=100
MLOSS=0
STATUS=Open
PARAMETERS=
TYPE=
SETTINGS=
TAG=ID12

but grass.vector_what puts Layer 2 attributes into Layer 1

>>data = grass.vector_what(map = 'test',coord = (60.0, 70.0), distance = 1.0)
>>data
[{'Category': 20, 
'Map': 'test', 
'Layer': 1, 
'Key_column': 'cat', 
'Database': 'd:\\gis_db\\gauss-boaga\\test_sqlite.db', 
'Mapset': 'piacenza', 
'Driver': 'sqlite', 
'Length': '20.000000', 
'Attributes': {'STATUS': 'Open', 
               'LTYPE': '1', 
               'PARAMETERS': '', 
               'DIAMETER': '10', 
               'SETTINGS': '', 
               'MLOSS': '0', 
               'cat': '8', 
               'LENGTH': '5280', 
               'TAG': 'ID12', 
               'NODE1': '12', 
               'NODE2': '13', 
               'TYPE': '', 
               'ID': '12', 
               'ROUGHNESS': '100'}, 
'Table': 'net_table', 
'Type': 'Line', 
'Id': 20}]

Change History (6)

in reply to:  description comment:1 by artegion, 13 years ago

but from Digitize "Diplay/update attributes" button (wxPython) it works......

comment:2 by hamish, 13 years ago

Description: modified (diff)

verbatim formatting applied to ticket description.

comment:3 by hamish, 13 years ago

Keywords: vector_what added

comment:4 by wenzeslaus, 12 years ago

The vector_what function (file vector.py) should by fixed in GRASS 7 in r52824.

vector_what tested with some handmade maps with multiple layers (with and without dblink). Please, confirm.

This blocked (or blocks) #1606 (part of #1606 is duplicate of this ticked).

(vector_what is used only in the GUI so r52824 should not break anything.)

comment:5 by annakrat, 12 years ago

Another related change: r52832. Please test it so that it can be backported before release.

Thanks, Anna

comment:6 by annakrat, 12 years ago

Resolution: fixed
Status: newclosed

It seems to work, related ticket #1606 was closed as fixed. Backported in r52853, r52855.

Anna

Note: See TracTickets for help on using tickets.