blankblank blank




Fixing "Broken" Shapefiles



Ever get an error message when opening a shapefile like, “Number of shapes does not match number of table records”? Yeah, well, neither have I. But if you ever do have such a problem, the Shape Checker utility might be able to rescue at least some, if not most of your data. It can re-generate a new .shx index file for your .shp file, add or delete lines to the .dbf file to match the number of shapes, and if your DBF file is totally hosed, can recreate a blank DBF for that shapefile. Not great, since you’ll lose whatever data you had in that datafile, but better than losing everything.

As the web page suggests, it’s probably best to do this on a copy of the corrupted file, rather than the original itself. Run the program:

shapechecker

Select the problematic .shp file with the left button, then recreate the .shx file with the “Build Shx” button. You can then check the DBF file for the proper number of records with the Check DBF button; if there are problems, or if the DBF file is missing, you’ll be given the option to fix it or create a blank one from scratch. I’ve tried it on point, line and polygon shapefiles I screwed up deliberately, and it worked as advertised. The program hasn’t been updated since 1999, but the author also provides the Delphi source code if you want to modify it yourself.

Related posts:

  1. Another Shapefile Repair Tool
  2. Fixing Corrupt Shapefiles
  3. An Easier Way To Convert Shapefiles to Text/Spreadsheet Format
  4. Converting Raster Area Images Into Polygon Shapefiles
  5. The Last Word (For Now) On Converting Google Earth KML Files To Shapefiles
  6. Intro To MapWindow IV – Advanced Vector Tools
  7. Converting Text/Spreadsheet Data To Line/Area Shapefiles
  8. Export Shapefiles To Google Earth II – Shp2KML Converter
  9. A Simple DBF Editor
  10. Convert Shapefiles Into SVG Format With Thematic Coloring
  11. Recap Of Intro To MapWindow GIS Series
  12. Intro To MapWindow GIS III – Shapefile Editing
  13. Converting Point Shapefiles To Text/Spreadsheet Format
  14. Exporting Shapefiles To Google Earth IV – Shape2Earth
  15. Exporting Shapefiles To Google Earth III – shp2kml

Looking for something else? Enter some keywords below, then click "Search".    




5 Responses to “Fixing "Broken" Shapefiles”


  1. 1 Simon Jackson

    saved me a number of times. I found the main cause was editing shapefiles over slow network connections.

    http://support.esri.com/index.cfm?fa=knowledgebase.techarticles.articleShow&d=17791

  2. 2 David McGraw

    I have also used Shape Checker to successfully repair shapefiles on several occasions.

  3. 3 olga

    thank you so much for this tool, it really safed my work. there were little problems because the toll created a new polygon which was infinite, but i could kick it out by choosing the proper polygons and create a new shapefile from them, so there are just a few informations missing now. so my day has a happy end now…

  1. 1 Tiny geocoder « LocalLab : Foire aux Infos
  2. 2 ECNEGROUP » Blog Archive » Membaiki fail shapefile yang rosak
Comments are currently closed; feel free to contact me with questions/issues.