arcpy遍历属性字段遇到Number of shapes does not match the number of table records

这个错误有两种情况:
1.使用arcpy 遍历属性时遇到如下错误,遍历用的cursor = arcpy.UpdateCursor(xx)

RuntimeError: ERROR 999999: Error executing function.
Number of shapes does not match the number of table records

2.程序正常跑完时在arcgis里加载矢量图层时弹出错误窗口,窗口上写着can not open specified file字样。如果不打开,直接用几何修复工具修复出现与1同样的错误提示。
arcgis

解决方案:
这个问题在网上都说要用一个叫shapechk的工具,但是大多数都要积分,这里我不服,偏偏就找到了,而且在此分享:
链接:https://pan.baidu.com/s/1Guf1l3rBsIKnUrRw66jcGQ
提取码:mcvj

软件的使用方法非常简单,打开以后里面的按钮从左往右点一遍,最后一个按钮点两遍,结果就修复了。

另外附上一个解决这个问题的链接,而且也提供了上面那个软件
https://blog.sunzexiang.com/archives/59.html

猜你喜欢

转载自blog.csdn.net/qq_20373723/article/details/109252975