概述
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处有什么问题吗?
最后
以上就是俭朴大门为你收集整理的Arcgis toolbox导入python script运行出错,实在找不出脚本哪里有问题。求助的全部内容,希望文章能够帮你解决Arcgis toolbox导入python script运行出错,实在找不出脚本哪里有问题。求助所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复