[QGIS-trac] [Quantum GIS] #1244: QGIS should warn/disallow selecting shapefiles that contain spaces

Quantum GIS qgis at qgis.org
Sun Aug 24 07:43:56 EDT 2008


#1244: QGIS should warn/disallow selecting shapefiles that contain spaces
------------------------------------------------+---------------------------
   Reporter:  pmcdermott                        |              Owner:  nobody       
       Type:  enhancement                       |             Status:  new          
   Priority:  major: does not work as expected  |          Milestone:  Version 1.0.0
  Component:  OGR Layer support                 |            Version:  0.11.0       
   Keywords:  shapefile, SQL                    |   Platform_version:               
   Platform:  Gentoo                            |           Must_fix:  No           
Status_info:  0                                 |  
------------------------------------------------+---------------------------
 QGIS should either warn or disallow selecting shapefiles which contain
 spaces in "Add a Vector Layer", and explain why.

 The ESRI Shapefile Technical Description says that shapefiles should
 follow the 8.3 naming convention, using characters a-Z,0-9,_,-. The
 practical consequence of shapefile names containing spaces is that SQL
 queries of the shapefiles data using the GDAL library will fail, with an
 error message of the form:

 ERROR 1: SQL: Failed to parse SELECT statement, extra input at 2 token.

 I presume this is due to insufficient quoting in the construction of the
 SQL query statements.

 The cause of this error is difficult to track down, and is ultimately due
 to user input which could be considered erroneous. But given the ease with
 which spaces can now be inserted into file names, this sort of user error
 is easy to make.

 An alternative approach would be to allow long filesnames and filenames
 with spaces and other characters, but this would mean moving away from the
 ESRI specification. SQL queries would have to be properly quoted, and I
 presume there would need to be some sort of check for valid Xbase table
 names. (e.g. is a U with an umlaut a valid Xbase table name?)

-- 
Ticket URL: <https://trac.osgeo.org/qgis/ticket/1244>
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