Hi all,
I've attached a screenshot of the model I'm trying to run. Essentially, it iterates through the polylines in a layer and for each line, generates points, and then splits each line at the points. The outputs are routed into a geodatabase as individual layers. I have multiple polyline layers I have to use this model for, and the one I'm attempting first has 1,700 or so features, which is the least out of any of the layers. The problem is that the model keeps freezing at random points between 100-600 outputs created when routed to a geodatabase. Interestingly, when I routed the outputs to a folder on the desktop, it ran smoothly and through all the features without any problems, but lost geometry and created problems when the resulting shapefiles were used later. I'm running this and pulling all data from the local drive, but I just can't seem to increase the performance enough to put the outputs into a geodatabase.
If scripting would make the process quicker, I've also tried using a search cursor to accomplish the same thing. The script runs once and accomplishes what I need for a single feature and then stops. I can't get the cursor to step to the next row, so here's the code if there's a simple improvement there.
import arcpy
arcpy.env.workspace = "C:\\Users\\ccurtin\\Desktop\\Data\\ES_Routes\\UPC\\King_JR_ES.gdb"
arcpy.env.overwriteOutput = False
field = ["OBJECTID"]
cursor = arcpy.da.SearchCursor("King_JR_ES_Routes", field)
with arcpy.da.SearchCursor("King_JR_ES_Routes", field) as cursor:
for row in cursor:
select = "OBJECTID = {}".format(row[0])
arcpy.management.SelectLayerByAttribute("King_JR_ES_Routes", "NEW_SELECTION", select, None)
arcpy.management.GeneratePointsAlongLines("King_JR_ES_Routes", r"C:\Users\ccurtin\Desktop\Data\ES_Routes\UPC\King_JR_ES.gdb\King_JR_ES_points_%n%", "DISTANCE", "150 Feet", None, None)
arcpy.management.SplitLineAtPoint("King_JR_ES_Routes", r"C:\Users\ccurtin\Desktop\Data\ES_Routes\UPC\King_JR_ES.gdb\King_JR_ES_points_%n%", r"C:\Users\ccurtin\Desktop\Data\ES_Routes\UPC\King_JR_ES.gdb\King_JR_ES_splitroutes_%n%", "5 Feet")
Any help would be much appreciated, whether it be an improvement to the model, system performance tips, or script improvement. Thanks!