AnsweredAssumed Answered

Update Cursor not calculating in a table, vector Tab Area

Question asked by rgthurau on Sep 11, 2012
Latest reply on Sep 11, 2012 by rgthurau
Hi Community,
I have a summary table that essentially holds a one to many relationship between a number of polygons with a unique ID (GID) and different land uses. I want update cursor to look at the attribute "Class" and then populate the field name matching the class attribute with the Sum_Shape_Area value. I will then use join field back to polygon layer to get areas by land use.

Essentially, this is a tab area process in vector format.

Conceptually, the code seems straight forward to me, but the table is not being populated. Code follows.
Anyone know what is happening here?

Also, if anyone has workflow suggestions for a vector-based tab area, I'd love to hear it.

Image of some of the table is attached. I'm running the code from a table within a file geodatabase.

Thanks,

Rich



FieldList = ["NoData", "Tree_Canopy", "Veg_Suitable", "Soil", "Water", "Buildings", "Roads", "IA_Suitable", "Veg_Unsuitable", "IA_Other_Unsuit"]   rows = arcpy.UpdateCursor(Table) for row in rows:     if row.Class == row.getValue(FieldList[0]):         row.setValue(row.FieldList[0], row.SUM_Shape_Area))         rows.updateRow(row)     elif row.Class == row.getValue(FieldList[1]):         row.setValue(row.FieldList[1], row.SUM_Shape_Area))         rows.updateRow(row)     elif row.Class == row.getValue(FieldList[2]):         row.setValue(row.FieldList[2], row.SUM_Shape_Area)         rows.updateRow(row)     elif row.Class == row.getValue(FieldList[3]):         row.setValue(row.FieldList[3], row.SUM_Shape_Area)         rows.updateRow(row)     elif row.Class == row.getValue(FieldList[4]):         row.setValue(row.FieldList[4], row.SUM_Shape_Area)         rows.updateRow(row)     elif row.Class == row.getValue(FieldList[5]):         row.setValue(row.FieldList[5], row.SUM_Shape_Area)         rows.updateRow(row)     elif row.Class == row.getValue(FieldList[6]):         row.setValue(row.FieldList[6], row.SUM_Shape_Area)         rows.updateRow(row)     elif row.Class == row.getValue(FieldList[7]):         row.setValue(row.FieldList[7], row.SUM_Shape_Area)         rows.updateRow(row)     elif row.Class == row.getValue(FieldList[8]):         row.setValue(row.FieldList[8], row.SUM_Shape_Area)         rows.updateRow(row)     elif row.Class == row.getValue(FieldList[9]):         row.setValue(row.FieldList[9], row.SUM_Shape_Area)         rows.updateRow(row)

Attachments

Outcomes