I’ve posted before on two free Windows apps for fixing corrupt shapefiles, Shape Checker and Shapefile Repair Tool. PerryGeo describes a third option: use the command-line tool ogr2ogr to re-write the shapefile under a new name, hopefully with the corrupt parts fixed. From that post, and from its comments, you would use the following command operation:
ogr2ogr -f “ESRI Shapefile” –skipfailures shiny_new_clean_dataset.shp corrupted_dataset.shp corrupted_dataset
Don’t like command-line operations? The free ogr2ogr GUI ogr2gui can do the same operation, with a little extra effort:
1. Select the corrupt shapefile as the source, and set the Target type as “Shapefile”:
2. Add in the “-skipfailures” switch by typing in the line command box below:
3. Click “Execute”, and you’re done. Unfortunately, I didn’t have a corrupt shapefile to test it on, but worked fine on a good shapefile. If you’ve got a corrupt shapefile, let me know if it worked for you.
Keep in mind that this isn’t a guaranteed fix. PerryGeo’s post quotes a 90% success rate, and the comments to the post note that sometimes in a corrupt shapefile, the fixed file may not have the attributes correctly linked to the matching shapes. YMMV.