Select to view content in your preferred language

Spatial Join ERROR 000725: Output Feature Class: GISLAYER already exists

2729
2
06-29-2011 01:18 PM
AshakaThakore
Emerging Contributor
I created a simple model, it has spatial join, it takes two feature classes (parameters are hardcoded) and then does a spatial join and the outputs the joined features. The output feature class is also hardcoded.

I want to do a spatial join and the output should be overwritten to that hardcoded feature class...
It works fine in model builder, But when i export that model to python script and i run that python script i get this error -

Spatial Join ERROR 000725: Output Feature Class: GISLAYER already exists
Tags (2)
0 Kudos
2 Replies
LoganPugh
Frequent Contributor
See: http://blogs.esri.com/Dev/blogs/geoprocessing/archive/2011/06/24/ExportModelToPy.aspx

Specifically add arcpy.env.overwriteOutput = True before your spatial join operation.
0 Kudos
AshakaThakore
Emerging Contributor
thanks ...
i am using 9.3 so this worked for me

gp.overwriteoutput = True

thanks again
0 Kudos