[GRASS5] [bug #2386] (grass) v.in.ogr exits with error when importing shapefile that uses SQL reserved words as attribute names

Request Tracker grass-bugs at intevation.de
Sat Apr 17 13:39:21 EDT 2004


this bug's URL: http://intevation.de/rt/webrt?serial_num=2386
-------------------------------------------------------------------------

Subject: v.in.ogr exits with error when importing shapefile that uses SQL reserved words as attribute names

Platform: other
grass obtained from: CVS
grass binary for platform: Compiled from Sources
GRASS Version: grass57 CVS checked out 20040321

Because the grass57 vector support now uses SQL, there are new restrictions on the names that shapefiles can use for attributes in the DBF file.  

Unfortunately, there are numerous shapefiles available from GIS sources that use SQL reserved words such as "DATE" for field names --- I have a collection of such shapefiles from the US Forest Service that I would like to import into Grass 5.7.

When I try to import files like this, v.in.ogr exits with an "SQL parser error" message.  It took a lot of playing around to figure out what it was that was causing the error, and it was all due to the presence of the single "DATE" field.  At a minimum, the error message should say what the parser error actually is rather than just that there was one.

v.in.ogr already tries to fix up field names that contain characters that are illegal in SQL.  It should also attempt to rename fields that are SQL reserved words.  This might be tricky, of course, because it could rename the field to   something that already exists in the dbf file.


-------------------------------------------- Managed by Request Tracker




More information about the grass-dev mailing list