[Shapelib] DBFAddField

Frank Warmerdam fwarmerdam at gmail.com
Tue Mar 1 09:50:53 EST 2005

On Tue, 1 Mar 2005 09:59:22 +0100, Helmut Lorentz <helmut.lorentz at gmx.de> wrote:
> Hi,
> I want to add a Field to the Attributtable from a Shape. The Problem is,
> that the Shape just has records but shapelib does not allow adding fields to
> dbf-files with records. May be there is someone who has a solution for this
> problem?


I have deliberately kept the DBF processing relatively distinct from the
SHP processing in shapelib so it would be easy to use other libraries
for operating on the dbf file.  I am sure if you search around for libraries
that operate on "dbf" or xbase files you will find lots with much better
capabilities than what is in Shapelib. 

Alternatively, you could add the capability to your local dbfopen.c 
yourself.  The format is relatively straight forward.  But you will need
to reorganize all the existing records in the file to make space for
the new field, and update the header accordingly. 

Best regards,
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

More information about the Shapelib mailing list