[GIS] Fixing corrupt shapefile

arcgis-9.3arcgis-desktopeditingogrshapefile

I have a shapefile that I was working on in ArcGIS Desktop 9.3 get corrupted somehow and it gives me the error "Number of shapes does not match the number of table records.". What I would want is to recover this shapefile as it has a lot of edits that other revisions of the file do not have.

Earlier I recovered from this error using ogr2gui but the tool now just crashes. I have even tried the command line version ogr2ogr but still no luck. This script, Shapefile Repair Tool from the ArcScripts website didn't help either.

Any ideas? (except that I stop using shapefiles)


Here is the output from ogr2ogr (based on a a suggestion in the answers): enter image description here

Best Answer

An option, with the lost of the corrupted features, could be to use ogr2ogr converting your shapefile to another shapefile, with the -skipfailures option:

ogr2ogr -skipfailures fixed_shapefile.shp corrupted_shapefile.shp

for further details look at this blog post from PerryGeo blog:

http://www.perrygeo.net/wordpress/?p=132

Related Question