Python在第二个搜索光标中无法识别我的参数(row
)。
我在arcmap中使用了两个图层。第一个是自治市镇,第二个是已经在Borogh油田附近的道路。
cursor = arcpy.da.SearchCursor('London_Borough_Excluding_MHW', ["NAME"])
length = 0
delimit = arcpy.AddFieldDelimiters('London_Borough_Excluding_MHW',["NAME"])
>>> for row in cursor:
... name = row[0]
... cursor2 = arcpy.da.SearchCursor("Join_roads_sorted",["LENGTH_GEO"],"\"NAME_1\"= 'name'")
... for row2 in cursor2:
... length = length + row2[0]
... print length