[Shapelib] Deleting records

Frank Warmerdam fwarmerdam at gmail.com
Wed Jun 8 06:17:06 PDT 2005


On 6/4/05, Miha Ć tajdohar <stajdi at rutka.net> wrote:
> I just started using shapelib and I could not find out how to delete records
> from dbf file. I can overwrite them with null or empty string but
> DBFGetRecordCount still returns the old value. 
> 
> I would really appreciate your help, 

Miha, 

There is no support for deleting records in Shapelib.   If you dig into the
code I am sure you will find it is not too complicated, so you could
extend it to support deleting records from the .dbf file if you wanted,
however, be aware of the importance of keeping the shapefile in 
sync with the dbf file when doing so.  Removing a shape from the
shapefile will be a bit more work than removing a record from the
.dbf file. 

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