I am working on making improvements to my collection of Python scripts to produce statistical data reports on my in-service infrastructure system. Currently, I am using a file GDB with Feature Class to Feature Class AND Summary Statistics tools with SearchCursor tool to produce the counts. However, as my infrastructure grows and becomes more complex, the script is becoming less efficient.
I figured out how to do a SearchCursor to give me the total counts of a point feature class per specific attribute criteria:
# ALL MEWCo POLES
with arcpy.da.SearchCursor("eSUPPORT_STRUCTURE", "SHAPE@", "POLE_OWNER = 806") as cursor:
rows = {row[0] for row in cursor}
count = 0
for row in rows:
count += 1
print "MEWCo Poles: %s" % count However, what I am trying to do is take this same Cursor and use it to produce the total lengths on a polyline feature class from my existing code:
# OVERHEAD CONDUCTOR COUNTS
# Process: Primary Conductor FC to Temp GDB - OH Primary #1/0 CU
arcpy.FeatureClassToFeatureClass_conversion(ePRIMARY_CONDUCTOR, TempGDB_gdb, "OHPrimary10CU", "PLACEMENT = 500 AND CONDUCTOR_TYPE = '#1/0 CU' AND LIFE_CYCLE_STATUS = 8")
# Process: Summary Statistics - OH Primary #1/0 CU
arcpy.Statistics_analysis(OHPrimary10CU, OHPrimary10CU_Stats, "Shape_Length SUM", "")
I am a little stuck trying to work with a polyline FC versus a point FC. Appreciate your help