dbf driver: implicit duplicate column names
|Reported by:||mmetz||Owned by:|
The dbf driver in lib/external/shapelib limits the length of column names to 10 characters. Longer names are silently truncated to 10 characters without checking for duplicates. The dbf driver in db/drivers/dbf limits the length of column names to 20 characters and passes these too long names to lib/external/shapelib. This limit should be changed to 10 characters, otherwise column names longer than 10 characters with the first 10 characters being identical will result in identical column names in the dbf file. These identical column names create all sorts of (cryptic) problems, unfortunately without any warning or error.
It may be necessary to add routines to create unambiguous column names, or at least suggest alternative names to the user, e.g. as cnames option for v.in.ogr. Currently, add_column() in db/drivers/dbf/column.c will fail in case of duplicate column names with an error message but not a fatal error.