Details Ticket 2386


Comment | Reply | Take | Open


Serial Number 2386
Subject v.in.ogr exits with error when importing shapefile that uses SQL reserved words as attribute names
Area grass5.7
Queue grass
Requestors russo@bogoflux.losalamos.nm.us
Owner none
Status resolved
Last User Contact Wed Aug 11 16:31:50 2004 (4 yr ago)
Current Priority 30
Final Priority 70
Due No date assigned
Last Action Wed Aug 11 16:31:53 2004 (4 yr ago)
Created Sat Apr 17 19:39:21 2004 (4 yr ago)

Transaction History Ticket 2386


Sat, Apr 17 2004 19:39:21    Request created by guest  
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.
Wed, Aug 11 2004 16:31:50    Mail sent by mneteler  
There is a new parameter:
  cnames   List of column names to be used instead of original names, first is
used for category column.

which solves the problem.

Markus
Wed, Aug 11 2004 16:31:53    Status changed to resolved by mneteler  
Comment | Reply | Take | Open

You are currently authenticated as guest.
[Show Configuration] [Login as another user]

Users Guide - Mail Commands - Homepage of RequestTracker 1.0.7 - list any request