Ticket #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: | |
| Platform: | All | CPU: | All |
Description (last modified by hamish) (diff)
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
Note: See
TracTickets for help on using
tickets.
