[Gdal-dev] Shapefile Driver Updates

Frank Warmerdam warmerdam at pobox.com
Tue Jan 10 11:56:03 EST 2006


Folks,

With the kind support of SANZ, I have updated the
OGR shapefile driver to support update-in-place and
feature deletion.  Update in place (via SetFeature()) will
overwrite an existing shape.  If the new geometry is bigger
than the old one, then it will be written at the end of the
.shp file, but pointed to by the same shape entry in the
.shx file (so the FID remains unchanged).

Deleting features is implemented by marking the record
for deletion in the .dbf file.  OGR also now supports ignoring
deleted features based on the marker in the .dbf file, which
it did not do before.  The GetFeatureCount() will generally
return a wrong result if called on a file with deleted features.

To repack a shapefile (compressing out wasted space and
deleted records) you can invoke the shape specific
"REPACK <tablename>" via the ExecuteSQL() method on
the datasource.

The hope is that with these changes "in place update" on
shapefiles will be full-featured.

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 Gdal-dev mailing list