Fixing a shapefile

2,786 views
Skip to first unread message

Tom Bean

unread,
Jul 12, 2014, 3:39:09 PM7/12/14
to gis-in-eco...@googlegroups.com
Hi Colin,

I have edited the attribute table of the UK coastline shapefile and now it will not display. I added a column to add labels to each shapefile. 

The error occurs when I try and drag the original file back into the ArcMap window. It says Open Failed: Error opening feature class, Number of shapes does not match the number of table records. Then it says Warning: Could not add the specified data objects to the map; Number of shapes does not match the number of table records. 

How would I go about fixing this?

Thanks,
Tom

GIS in Ecology

unread,
Jul 13, 2014, 12:26:32 PM7/13/14
to gis-in-eco...@googlegroups.com
Hi Tom,
 
It's not quite clear how you have been editing the attribute table of your data layer, and so what's gone wrong. Were you editing the attribute table through ArcMAP itself (i.e. right-clicking on the name of a data layer in the TABLE OF CONTENTS window and selecting OPEN ATTRIBUTE TABLE) or were you editing it some other way (e.g. opening the attribute table .dbf file in a spreadsheet programme and editing it there)?
 
Either way, it sounds like the attribute table has become corrupted in some way. You could try editing the attribute table again and removing the fields you added and seeing whether that fixes it, but I don't think this would work.
 
Generally, when this happens, the best thing to is to go back to the original version of the file and start again. This is one of the reasons you should always keep an archived copy of any data layers you are working with, or which you create, so that you can always revert ot an earlier version if you run into these types of issues.
 
This probably won't help you fix your data layer as such, but it will be the quickest way for you to get your project working again. If this is a data layer which you don't have an archived copy of, then you could try using a shapefile fixer to identify the problem and help you solve it. There are a number of these around and they can be found by eitehr copying the error message into Google, or searching using the term shapefile fixer.
 
A couple I found when I did this are: http://arcscripts.esri.com/details.asp?dbid=10806, http://www.jodymarca.com/en/tools/shapefile-fixer/, and http://arcscripts.esri.com/details.asp?dbid=13733. I haven't tried any of these, so I can't guarantee that they will work, or that they will help you fix yoru problem, but they might be worth trying if you don't have an archived copy of your data layer.
 
I hope this helps.
 
All the best,
 
Colin

Tom Bean

unread,
Jul 14, 2014, 5:47:14 AM7/14/14
to gis-in-eco...@googlegroups.com
Yes, I was editing the attribute table through ArcMap itself, I am unable to reopen the attribute table again now so not sure how to remove the fields I entered?

GIS in Ecology

unread,
Jul 16, 2014, 10:09:20 AM7/16/14
to gis-in-eco...@googlegroups.com
Hi Tom,
 
This almost certainly means that the data layer files have become corrupted in some way, and you'd have to try some of the solutionss suggested above or go back to an original, unedited version of your data layer and start again.
 
Sorry not to be able to provide you with a morer positve answer on this one.
 
All the best,
 
Colin
Reply all
Reply to author
Forward
0 new messages