Bug report #3137

Save as shapefile fails if field names are longer than 10 characters

Added by Paolo Cavallini about 9 years ago. Updated over 8 years ago.

Status:Closed
Priority:Low
Assignee:nobody -
Category:Data Provider
Affected QGIS version: Regression?:No
Operating System:All Easy fix?:No
Pull Request or Patch supplied: Resolution:fixed
Crashes QGIS or corrupts data: Copied to github as #:13197

Description

If I try to save the attached MapInfo file, I get:

Export to vector file failed.
Error: trimming attribute name 'PM10_AVG_max' to ten significant characters produces duplicate column name.

and export fails. It seems a limitation of OGR, but perhaps we could be smarter and replace the last character with a serial.
Otherwise better forward this ticket to GDAL trac?

contour.mif.zip (10.7 KB) Paolo Cavallini, 2010-10-20 12:39 AM

Associated revisions

Revision f708fe7c
Added by Jürgen Fischer over 8 years ago

fix #3137

git-svn-id: http://svn.osgeo.org/qgis/trunk/[email protected] c8812cc2-4d05-0410-92ff-de0c093fc19c

Revision b642e809
Added by Jürgen Fischer over 8 years ago

fix #3137

git-svn-id: http://svn.osgeo.org/qgis/[email protected] c8812cc2-4d05-0410-92ff-de0c093fc19c

History

#1 Updated by Paolo Cavallini about 9 years ago

BTW, the external plugin Table Manager fails to rename the fields, hanging QGIS

#2 Updated by Jürgen Fischer about 9 years ago

Replying to pcav:

and export fails. It seems a limitation of OGR, but perhaps we could be smarter and replace the last character with a serial.

AFAIK it's not a limitation of OGR, but a limitation of D-Base format.

#3 Updated by Paolo Cavallini about 9 years ago

I mean: the lack of a proper truncation method, adding a serial in case of too long field names, may be a limitation of OGR.

#4 Updated by Frank Warmerdam - about 9 years ago

If the ticket is filed against GDAL, I can have Chaitanya look into clean logic for disambiguation for shortened names.

#5 Updated by Jürgen Fischer about 9 years ago

If this is fixed in OGR we need to keep in mind to adapt http://trac.osgeo.org/qgis/browser/trunk/qgis/src/core/qgsvectorfilewriter.cpp#L312 accordingly.

#7 Updated by Paolo Cavallini about 9 years ago

Apparently the problem has been solved in GDAL 1.7. The method in QGIS should then be updated. See http://trac.osgeo.org/gdal/ticket/3796#comment:1

#8 Updated by Jürgen Fischer over 8 years ago

  • Resolution set to fixed
  • Status changed from Open to Closed

fixed in b642e809 (SVN r15239).

Also available in: Atom PDF