Using the Intersect_analysis function with a SearchCursor results in duplicate features in ArcMap Python 2.7.14 and Python 3.6.7.
上次发布: March 19, 2019ArcGIS for Desktop
漏洞 ID 编号
BUG-000119731
已提交
January 30, 2019
上次修改时间
July 4, 2025
适用范围
ArcGIS for Desktop
找到的版本
10.6.1
操作系统
Windows OS
操作系统版本
10.0
修正版本
2.9
状态
Fixed
此漏洞已得到修复。 有关详细信息,请参阅“版本修复”和“其他信息”(如果适用)。
解决办法
Use the function outside the SearchCursor and export every feature from the Output to a new feature class or shapefile or use the following code:import arcpymerged = arcpy.CopyFeatures_management("test", arcpy.Geometry())[0]with arcpy.da.SearchCursor('fishnetpoly', ["SHAPE@","OID@"]) as sCursor: for row in sCursor: intersect = merged.intersect(row[0], 4) arcpy.CopyFeatures_management(intersect, "intersected_{0}".format(row[1])) print ("Intersected " + str(row[1]))