[QGIS-trac] Re: [Quantum GIS] #1295: spatial index fails

Quantum GIS qgis at qgis.org
Wed Oct 8 22:19:05 EDT 2008


#1295: spatial index fails
-----------------------------------------------------+----------------------
        Reporter:  gespiel                           |         Owner:  jef          
            Type:  patch                             |        Status:  new          
        Priority:  major: does not work as expected  |     Milestone:  Version 1.0.0
       Component:  Vectors                           |       Version:  HEAD         
      Resolution:                                    |      Keywords:               
Platform_version:  XP sp2                            |      Platform:  Windows      
        Must_fix:  Yes                               |   Status_info:  0            
-----------------------------------------------------+----------------------
Changes (by smizuno):

  * status:  reopened => new
  * owner:  nobody => jef
  * type:  bug => patch

Comment:

 I am providing a patch that fixes this problem and also #1244 (spaces in
 file names).

 This uses QFileInfo::completeBaseName() to extract the file name to use as
 the layer name in createSpatialIndex(). It handles both / and \. It also
 deals with a potential problem with multiple dots (.) in a file name.
 Identifier quoting is also applied.

 I also noticed that deleteFeatures() fails in the REPACK statement as
 well, although it is silent. The feature count isn't correct. So
 completeBaseName() is used here, too. Note that REPACK is very particular
 - it doesn't work with quotes, but it does accept spaces in the layer
 name, even a leading space.

 Addtionally, mEncoding->fromUnicode() was applied to the calls to OGR for
 better i18n handling as has been done in some other functions.

 I also used QFileInfo::completeBaseName(), replacing
 QFileInfo::baseName(), in several other functions calling the layer name
 in similar ways in SQL statements.

 I have only tested this with GDAL/OGR 1.5.2, so I'm not sure how other
 versions will work with this patch.

-- 
Ticket URL: <http://trac.osgeo.org/qgis/ticket/1295#comment:4>
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