laptop and a wrench

Bogue

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

Dernière publication: August 25, 2014 No Product Found
Numéro d’ID de bogue NIM090113
EnvoiMarch 27, 2013
Dernière modificationJune 5, 2024
S’applique àNo Product Found
Version trouvée10.1
Version de correction10.2.1
StatutFixed

Solution de contournement

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()

Étapes pour reproduire

ID de bogue: NIM090113

Logiciel:

  • No Product Found

Recevoir une notification lorsque le statut d’un bogue change

Télécharger l’application Esri Support

En savoir plus sur ce sujet

Obtenir de l’aide auprès des experts ArcGIS

Contacter le support technique

Télécharger l’application Esri Support

Accéder aux options de téléchargement