AnsweredAssumed Answered

trouble with clip in search cursor

Question asked by geonetadmin on Dec 22, 2010
Latest reply on Apr 5, 2011 by geonetadmin
Original User: jkass

Having trouble with this script. Trying to clip the streams layer by each row of a watershed polygon. Getting the error "in Clip raise e". Any suggestions?

import arcpy
from arcpy import env
import os

arcpy.env.workspace = "path"
arcpy.env.overwriteoutput = 1
streams = "streams.shp"
rows = arcpy.SearchCursor("ws_boundary.shp")
for row in rows:
        wsname = str(row.DWRHANAME)
        outshp = "streams\\str" + "_" + wsname.replace(" ", "_") + ".shp"
        arcpy.Clip_analysis(streams, rows, outshp)
        print str(row.DWRHANAME) + "_has finished"