SHP文件错误及解决办法
时间:2007-08-27 来源:iceglacier
以前做的项目中的shp文件是可以加载的,可以对外发布.后来因为整个服务器,操作系统,web服务器,等全部更新.然后导师让再做的时候发生了以下的问题.
错误描述:
shapefile无法打开:Error opening feature class.Number of shapes does not match the number of table records
错误原因:shapefile文件已损坏,导致空间记录数和属性记录数不匹配。
那有是什么导致shp文件被损坏呢.总结有以下几个原因:
• Adding or deleting records to the DBF file corresponding to the existing shapefile.
• A system failure occurs during the edit process and the shapefile is saved in a corrupted state.
• Multiple users editing the same shapefile.
• Adding features to a theme and the user double-clicks the mouse. A record with zero area is added to the table, but the feature may not be visible in the view. 上面这几点是ESRI公司网站上找到的 .File *.dbf Terserang Virus KSpoold.exe 这一条是我在一家德国网站上找到的,在此提醒大家,病毒可以破坏shp文件,要做好病毒防治工作 Solution or Workaround You may be able to recover the shapefile with one of the following methods.
It is highly recommended you make a back up copy of the shapefile before attempting to use any of these methods.
• A system failure occurs during the edit process and the shapefile is saved in a corrupted state.
• Multiple users editing the same shapefile.
• Adding features to a theme and the user double-clicks the mouse. A record with zero area is added to the table, but the feature may not be visible in the view. 上面这几点是ESRI公司网站上找到的 .File *.dbf Terserang Virus KSpoold.exe 这一条是我在一家德国网站上找到的,在此提醒大家,病毒可以破坏shp文件,要做好病毒防治工作 Solution or Workaround You may be able to recover the shapefile with one of the following methods.
It is highly recommended you make a back up copy of the shapefile before attempting to use any of these methods.
- Use Andrew Williamson's Shapechecker utility. Click the link in Related Information and navigate to the 'How To / Useful' section.
- Edit the DBF file.
1. Open the DBf file.
2. Delete the last record.
3. Close and save the DBF file.
4. Load the shapefile into your View.
You may try this method multiple times.
- Use the ArcInfo Workstation SHAPEARC command.
1. Run the SHAPEARC command on the shapefile.
2. Run DESCRIBE on the output coverage.
3. Make note of the number of shapes.
4. Open the DBF corresponding to the shapefile.
5. Compare the number of records of the DBF to the number shapes resulting from the DESCRIBE command.
a) If the number of DBF records is more than the number of shapes, delete records until the number of shapes matches the number of records.
b) If the number of DBF records is less than the number of shapes, add records until the number of shapes matches the number of records.
6. Save the DBF file.
The shapefile should open in ArcView, but there is no guarantee that attribute information for the shapefile will be correct. To test if the attribute data is assigned to the correct feature, do the following:
1. Load the shapefile into a new view.
2. Open the attribute table for the shapefile.
3. Tile the view and the table
4. Select a record.
5. Compare the selected record with the selected feature in the view.
6. If the feature does not correspond with the attribute, determine whether and where to add or delete records. You will have to edit the DBF appropriately, keeping in mind that the number of records must equal the number of shapes.
Repeat the comparison steps until the features and attributes are synchronized. - Use the ArcInfo Workstation SHAPEARC command.
相关阅读 更多 +