Arcgis toolbox匯入python script執行出錯,實在找不出指令碼哪裡有問題。求助

lll1928發表於2018-04-27
import arcpy
arcpy.env.workspace = arcpy.GetParameterAsText(0)
inFeatures1 = arcpy.GetParameterAsText(1)
inFeatures2 = arcpy.GetParameterAsText(2)
outFeatureClass1 = arcpy.GetParameterAsText(4)  
outFeatureClass2 = arcpy.GetParameterAsText(5)
dissolveFields = arcpy.GetParameterAsText(3)
arcpy.Dissolve_management(inFeatures1, outFeatureClass1, dissolveFields)
arcpy.Dissolve_management(inFeatures2, outFeatureClass2, dissolveFields)
intersectOutput = arcpy.GetParameterAsText(6)
arcpy.Intersect_analysis ([outFeatureClass1,outFeatureClass2], intersectOutput, "ALL", "", "")
fieldPrecision = 18
fieldScale = 6
arcpy.AddField_management(intersectOutput, "New_Area", "FLOAT", fieldPrecision, fieldScale)
expression = "!SHAPE.area!"

arcpy.CalculateField_management(intersectOutput, "New_Area", expression, "PYTHON")

指令碼如上,主要是用到arcpy裡的dissolve和intersect功能,disslove是能正確執行的,但是intersect那部分執行不了,得不到結果圖層。
請問指令碼里intersect處有什麼問題嗎?

相關文章