I want to clip a polyline feature class by a polygon feature class (buffers created from points). Several polygons overlap, so I want to get each polygon feature clipped with each polyline feature.
Using the Clip_analysis tool, I get the orange lines:
whereas I want the following red lines:
In a python script, I tried the following code to clip every polyline with each polygon:
temp = arcpy.ValidateTableName("clip_temp") bufferCursor = arcpy.SearchCursor(buffer) n = 0 for pRow in bufferCursor: arcpy.AddMessage(n) feat = pRow.Shape arcpy.Clip_analysis(inputPolylineLayer, feat, temp, "#") if n == 0: arcpy.Copy_management(temp, clip) else: arcpy.Append_management(temp, clip) n=n+1
But the execution is very very slow and it crashes before finishing.
I also tried the Intersect_analysis tool but I didn't get the right geometries:
Do you have any idea of a better methods to do it?