[gdal-dev] Re: Editing attributes with ogr causing corrupt shapefile

Tom Jeffery tjeffery at gmail.com
Thu Aug 5 09:02:00 EDT 2010


Frank,

Your solution seems to work for me.  I don't know ArcGIS well enough to dig
into why it behaves that way, but deleting the features outside the claimed
extent (they aren't showing up as null in ogr), then using ogr2ogr does
result in a safe, non-corrupt shapefile that is usable with both ArcGIS and
ogr.  Thanks for the suggestion!

-Tom


Frank Warmerdam wrote:
> 
> Tom,
> 
> I believe OGR takes the approach of marking shapes deleted by setting the
> deleted flag in the .dbf file.  As far as I knew, this is a reasonable
> approach as far as ArcGIS is concerned.  I don't know why ArcGIS does
> something that corrupts the file.  If you figure out the issue let us
> know.
> 
> In the meantime, after doing the cleanup operation you can run ogr2ogr on
> the file to create a new file with all deleted records/shapes discarded.
> 
> eg.
> ogr2ogr out.shp in.shp
> 
> 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
> 
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
> 
> 

-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/gdal-dev-Editing-attributes-with-ogr-causing-corrupt-shapefile-tp5372483p5376367.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.


More information about the gdal-dev mailing list