Opened 12 years ago

Closed 12 years ago

#4014 closed defect (invalid)

Exporting ShapeFile

Reported by: lfedje Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: unspecified
Severity: normal Keywords:


I am new to QGIS so please bear with my ignorance.

I am using QGIS Version 1.6.0 on an iMac i7.

I created a Google Earth plotting of over 1000 properties with fairly long titles and substantial descriptions. One of my clients wants me to provide them with a ShapeFile of their properties together with the text so that they can load it onto their existing GIS system.

This is what I have done so far:

I added a vector layer from a kml file I produced from Google Earth. The shapefile opens up just beautiful in QGIS and if I click on any one of the properties (using the info icon) all of the pertinent information that I put into Google Earth shows up just fine in "identify results". The problem that I am having is that when saving the shapefile ( Layer > Save As > ESRI Shapefile). The result when viewed on my clients system is that the shapes show up perfectly but the text information is truncated. I took a look at the data in the dbf file and find that all of the descriptions and names are shown as character,80.

Is there any way to increase the field size for name and description of the data being exported or is it just the nature of the program?

I was advised by a member of the Quantum GIS Forum that perhaps this is a structured limit, or perhaps even a bug.

Thanks in advance

Change History (1)

comment:1 by Even Rouault, 12 years ago

Resolution: invalid
Status: newclosed

By default, when the code that uses OGR to add a field definition in the DBF doesn't provide an explicit width for text fields, OGR will use 80 as a random guess (see ). This can be changed if QGIS specifies an explicit width thanks to OGR_Fld_SetWidth() before calling OGR_L_CreateField(). Note however that the upper limit handled by shapelib is 255 characters.

So I don't think it's an OGR bug. QGIS must provide the appropriate width (which probably means pre-iterating over each feature in the layer to compute this width).

Note: See TracTickets for help on using tickets.