Select to view content in your preferred language

Having an error while creating Intersect tool using python script

2278
11
Jump to solution
12-19-2021 08:39 AM
sabafatima
Emerging Contributor

Hello Community members!

I am trying to make an intersect tool using the python script but it is giving me errors after I try to run the created tool. Can any expert help me, please?

This is the Python script:

import arcpy
arcpy.env.workspace = "C:/Users/SABA FATIMA/Desktop/GIS App Labs/lab_pythontoolCreation"
inputfeature=arcpy.GetParameterAsText(0)
intersectfeature=arcpy.GetParameterAsText(1)
outputfeature=arcpy.GetParameterAsText(2)
cluster_tolerance =0.15
arcpy.Intersect_analysis([inputfeature,intersectfeature],outputfeature, cluster_tolerance, "polygon")

 

This is the error:

Failed script Script...

Traceback (most recent call last):
File "C:\Users\SABA FATIMA\Desktop\GIS App Labs\lab_pythontoolCreation\intersectPolygon.py", line 7, in <module>
arcpy.Intersect_analysis([inputfeature,intersectfeature],outputfeature, cluster_tolerance, "polygon")
File "c:\program files (x86)\arcgis\desktop10.7\arcpy\arcpy\analysis.py", line 334, in Intersect
raise e
ExecuteError: ERROR 000622: Failed to execute (Intersect). Parameters are not valid.
ERROR 000628: Cannot set input into parameter cluster_tolerance.


Failed to execute (Script).

0 Kudos
11 Replies
JayantaPoddar
MVP Esteemed Contributor

Replace "polygon" with "INPUT"

 

arcpy.Intersect_analysis([inputfeature,intersectfeature],outputfeature, "", "","INPUT")

 



Think Location
0 Kudos
sabafatima
Emerging Contributor

It worked. Thank you so much!!!

i have been working on it for more than 10 hours.

0 Kudos