[GRASS-dev] [GRASS GIS] #2431: vector_what fails with multiple layer/cat
GRASS GIS
trac at osgeo.org
Tue Sep 23 01:17:38 PDT 2014
#2431: vector_what fails with multiple layer/cat
-------------------------+--------------------------------------------------
Reporter: artegion | Owner: grass-dev@…
Type: defect | Status: new
Priority: major | Milestone: 6.4.5
Component: Vector | Version: svn-releasebranch70
Keywords: | Platform: All
Cpu: Unspecified |
-------------------------+--------------------------------------------------
in a vector with multiple cat per point (in this case Point Id=3 has
4 cats:
[(layer=1, cat=311),(layer=1, cat=312),(layer=21, cat=321),(layer=2,
cat=322)]
while v.what gives a correct output:
{{{
v.what -a -g map=test at cavriago layer=2 coordinates=2.0,0.0
East=2
North=0
Map=test
Mapset=cavriago
Type=Point
Id=3
Layer=1
Category=311
Driver=sqlite
Database=D:\GIS_db\Gauss_Boaga\cavriago\sqlite.db
Table=test1
Key_column=cat
cat=311
t1=311
t2=
Layer=1
Category=312
Driver=sqlite
Database=D:\GIS_db\Gauss_Boaga\cavriago\sqlite.db
Table=test1
Key_column=cat
cat=312
t1=312
t2=
Layer=2
Category=321
Driver=sqlite
Database=D:\GIS_db\Gauss_Boaga\cavriago\sqlite.db
Table=test2
Key_column=cat
cat=321
l2=321
l3=
Layer=2
Category=322
Driver=sqlite
Database=D:\GIS_db\Gauss_Boaga\cavriago\sqlite.db
Table=test2
Key_column=cat
cat=322
l2=322
l3=layer2
}}}
vector_what makes a mess (It returns a single dictionary mixing up first
cat -> 'Category': 311, 'Layer': 1
and last cat -> 'Attributes': {'l2': '322', 'l3': 'layer2', 'cat': '322'}
{{{
from grass.script.vector import vector_what
vector_what(map='test', coord=(2.0,0.0), distance=0.0, ttype=None)
[{'Category': 311, 'Map': 'test', 'Layer': 1, 'Key_column': 'cat',
'Database': 'D:\\GIS_db\\Gauss_Boaga\\cavriago\\sqlite.db', 'Type':
'Point', 'Driver': 'sqlite', 'Table': 'test1', 'Attributes': {'l2': '322',
'l3': 'layer2', 'cat': '322'}, 'Mapset': 'cavriago', 'Id': '3'}]
}}}
This bug influences "Query result" dialog in wxGui while "Aggiornamento
attributi" in vector editing works correctly.
--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2431>
GRASS GIS <http://grass.osgeo.org>
More information about the grass-dev
mailing list