To do this efficiently you should read the 250,000 lines into a list with a da cursor (I assumed AO_Testing_Ln had the smaller number of features, but if AO_Fishnet_Testing has fewer lines it should be placed in the list instead). Then you should loop through a cursor on the Fishnet and loop through each line in the lineList to check for intersections. You should first test to determine if the extents intersect using a helper method I use then test for disjoint of the actual line shapes before intersecting, since both of those methods are faster than intersect for eliminating non-intersecting lines. I assumed you wanted to retain the OID of the Lines and Fishnet to get attributes from the lines later or to create a relate. The code below is untested, so errors may occur, but the code should be structured correctly:
import arcpy
Lines = r"C:\Users\Testing.gdb\AO_Testing_Ln"
lineList = [(r[0], r[1], r[1].extent) for r in arcpy.da.SearchCursor(Lines, ["OID@", "SHAPE@"])]
Fishnet = r"C:\Users\AO_Fishnet_Testing"
Output = r"C:\Users\Testing.gdb\Testing_Points"
env.workspace = r"C:\Users\Testing.gdb"
# Create a point feature class with the spatial reference of Lines
arcpy.CreateFeatureclass_management(r"C:\Users\Testing.gdb", "Testing_Points", "POINT", "", "DISABLED", "DISABLED", r"C:\Users\Testing.gdb\AO_Testing_Ln")
# Add a lineid field so that later attributes can be joined using Lines OIDs
arcpy.AddField_management("Testing_Points", "lineID", "LONG", 9, "", "", "lineID", "NULLABLE", "REQUIRED")
# Add a fishnetid field so that later attributes can be joined using Fishnet OIDs
arcpy.AddField_management("Testing_Points", "fishnetID", "LONG", 9, "", "", "fishnetID", "NULLABLE", "REQUIRED")
# create an insert cursor
fields = ['lineID', 'fishnetID', 'SHAPE@XY']
insertCursor = arcpy.da.InsertCursor(Output, fields)
counter = 0
# loop through the Fishnet lines and only intersect lines with extent overlap and not disjoint
with arcpy.da.SearchCursor(Fishnet, ["OID@", "SHAPE@"]) as cursor:
for row in cursor:
for i in range(0,len(lineList)):
if rectIntersect(row[1].extent, lineList[i][2]):
if not row[1].disjoint(lineList[i][1]):
pts = row[1].intersect(lineList[i][1], 1)
if pts.type == "point":
pts = [pts]
for p in pts:
insertCursor.insertRow((linelist[i][0], row[0],[p.X, p.Y]))
del p
del pts
counter += 1
if counter%10000 == 0: # adjust modulus amount to monitor progress
print("Completed processing of {0} Fishnet Lines".format(counter))
del insertCursor
# Helper method for determining if two feature extents do or do not intersect
def rectIntersect(R1, R2):
if ((R1.XMax < R2.XMin) or (R1.XMin > R2.XMax) or (R1.YMax < R2.YMin) or (R1.YMin > R2.YMax)):
return False
else:
return True
ln_geom
is a list of polyline geometries, so you are calling a method "intersect" on a list which clearly makes no sense. @Vince way is best, use a cursor stepping through each feature, get its geometry and then call the intersect method as you have done and store the resulting point in another featureclass.