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).
Solved! Go to Solution.
Replace "polygon" with "INPUT"
arcpy.Intersect_analysis([inputfeature,intersectfeature],outputfeature, "", "","INPUT")
It worked. Thank you so much!!!
i have been working on it for more than 10 hours.