[QGIS-trac] Re: [Quantum GIS] #554: identify - some varchar column displayed instead of the key column

Quantum GIS qgis at qgis.org
Mon Aug 11 12:28:42 EDT 2008


#554: identify - some varchar column displayed instead of the key column
-----------------------------------------------------+----------------------
        Reporter:  tutey at o2.pl                       |         Owner:  timlinux     
            Type:  bug                               |        Status:  reopened     
        Priority:  major: does not work as expected  |     Milestone:  Version 1.0.0
       Component:  Vectors                           |       Version:  HEAD         
      Resolution:                                    |      Keywords:               
Platform_version:  Ubuntu Dapper                     |      Platform:  Debian       
        Must_fix:  Yes                               |   Status_info:  0            
-----------------------------------------------------+----------------------
Changes (by msieczka):

  * status:  closed => reopened
  * version:  0.8 => HEAD
  * resolution:  fixed =>

Comment:

 Replying to [comment:6 timlinux]:
 > For me the issue is resolved now following this procedure:
 >
 > - load supplied 'wrong key' dataset
 > - open vector properties
 > - select general tab
 > - select 'cat' for display field
 > - close vector properties
 > - use identify tool to select a feature

 You did not understand the issue. It is that QGIS fails to recognise the
 *real* key column of the GRASS vector's dbf table. In case of the example
 vector map the key column is *cat*, not *name*. See the output of a
 command which confirms it:

 {{{
 $ v.db.connect -p wrong_key

 Vector map <wrong_key at wrong_key> is connected by:
 layer <1> table <wrong_key> in database
 </home/grassdata/wrong_key/wrong_key/dbf/> through driver <dbf> with key
 <cat>
 }}}

 In case of GRASS the id is "category" and nothing else ("category" is the
 official name in GRASS lingo). If the vector map has a table attached, the
 table contains a "key column" where "categories" are stored, and which
 lets link the vector features having "categories" with their attributes in
 the table. Usually the "key column" name is "cat", but it can be
 *anything*. v.db.connect -p can be used to detect the "key column" name.

 Anyway, in case of GRASS vectors it would be best to just use the
 "category" number as the node and not bother with detecting the "key
 column" at all (mind that GRASS allows multiple features to have the same
 "category", which provides the same functionality as Shapefile's or
 PostGIS  multi- feautures). If that's not possible now, please at least
 default to the *real* key column.

 I don't know what would be the right approach for other formats, but it
 looks very strange when in case of a Shapefile which has e.g. 2 columns
 'area' and 'length' one of them is used for the node. Wouldn't the
 "OGRFeature" be a better node candidate?

-- 
Ticket URL: <https://trac.osgeo.org/qgis/ticket/554#comment:7>
Quantum GIS <http://qgis.org>
Quantum GIS is an Open Source GIS viewer/editor supporting OGR, PostGIS, and GRASS formats


More information about the QGIS-trac mailing list