向“计算”字段添加值

时间:2016-03-08 13:02:23

标签: python

输出表circ2D中没有值:

需要为每个多边形添加字段circ2D为值circ2D添加填充:

arcpy.AddField_management(theme, "circ2D", "DOUBLE", field_length=13) 

for row in arcpy.da.SearchCursor(theme, ["FID","SHAPE@"]):  
    print ("Polygon # {}: ".format(row[0]))

    for part in row[1]:  # Inside the polygon

        xCoords = []
        yCoords = [] 
        zCoords = [] 
        for pnt in part:

        print (" {}, {}, {} ".format(pnt.X, pnt.Y, pnt.Z))
        xCoords.append(pnt.X)
        yCoords.append(pnt.Y)
        zCoords.append(pnt.Z) 

        perim2D = lab4_arcpy_module.definePerimeter(xCoords, yCoords)  

        area2D = lab4_arcpy_module.defineArea(xCoords, yCoords)  

        cirRatio2D = lab4_arcpy_module.defineCircularRatio(area2D, perim2D) 
arcpy.CalculateField_management(theme, "circ2D", str(cirRatio2D))   

但是,cirRatio2D实际上已经计算并进入打印声明。

enter image description here

输出文件在表中没有此值。 enter image description here

可能有什么问题?

0 个答案:

没有答案