laptop and a wrench

漏洞

Clip and other overlay operations run indefinitely with a particular line on a poly case.

上次发布: August 25, 2014 No Product Found
漏洞 ID 编号 NIM090113
已提交March 27, 2013
上次修改时间June 5, 2024
适用范围No Product Found
找到的版本10.1
修正版本10.2.1
状态Fixed

解决办法

To get a simplified, Intersect-like output (though not fully integrated or topologically complete across the entire extent of the data): import arcpy, os, sysarcpy.env.workspace = os.getcwd()arcpy.MakeFeatureLayer_management(r"Data.gdb\NEW_lines","lines")arcpy.MakeFeatureLayer_management(r"Data.gdb\NEW_fishnet","grids")arcpy.env.overwriteOutput = Truearcpy.CreateFileGDB_management(os.getcwd(),"output.gdb")try: #For each grid in the poly feature class, select it, select the lines that intersect it, then clip it with the selected grid. gridCount = int(arcpy.GetCount_management('grids')[0]) progressCounter = 1 with arcpy.da.SearchCursor("grids", "Cell_ID") as cursor: for row in cursor: print "\n\nGrid # " + str(progressCounter) + " of " + str(gridCount) print "Processing Cell_ID = " + str(row[0]) arcpy.SelectLayerByAttribute_management('grids',"","Cell_ID = " + str(row[0])) print "Selecting the lines..." arcpy.SelectLayerByLocation_management("lines","INTERSECT","grids","","") #print arcpy.GetMessages() print "Clipping the selected lines with the selected grid..." arcpy.Clip_analysis("lines","grids",r"output.gdb/LinesInCellID" + str(row[0])) #print arcpy.GetMessages() print "Add identification field..." arcpy.AddField_management(r"output.gdb/LinesInCellID" + str(row[0]),"Cell_ID", "LONG") #print arcpy.GetMessages() print "Assign grid id to field..." arcpy.CalculateField_management(r"output.gdb/LinesInCellID" + str(row[0]), "Cell_ID", str(row[0])) #print arcpy.GetMessages() progressCounter +=1 print "Merge all the outputs..." arcpy.env.workspace = os.path.join(os.getcwd(), r"output.gdb") fcList = arcpy.ListFeatureClasses() arcpy.Merge_management(fcList,r"output.gdb/mergedFC") print "DONE" #print arcpy.GetMessages() except: print "FAILED" print arcpy.GetMessages()

重现步骤

漏洞 ID: NIM090113

软件:

  • No Product Found

当漏洞状态发生变化时获得通知

下载 Esri 支持应用程序

发现关于本主题的更多内容

获取来自 ArcGIS 专家的帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项