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
|
|