I'm writing a script for field staff that clips all wetlands in a watershed, calculates area (hectares) and multiples by a sampling factor to see how many hectares need to be sampleHere is a sample of the update cursor part of the code: rows = arcpy.UpdateCursor(newWetland) row = rows.next() while row: if row.getValue(wetlandTypeField) == 'Estuarine and Marine Wetland': totalHectares = row.getValue(areaField) sampleArea = (totalHectares * .25) # Sample 25% of this type row.setValue(sampleField, sampleArea) rows.updateRow(row) row = rows.next() elif row.getValue(wetlandTypeField) == 'Freshwater Emergent Wetland': totalHectares = row.getValue(areaField) sampleArea = (totalHectares * .25) # Sample 25% of this type row.setValue(sampleField, sampleArea) rows.updateRow(row) row = rows.next()
There are several more elif blocks for each wetland type in the dataset.When I type in the python window:print sampleArea
I get the correct area, however, it does not update the row. The help files indicate that the second parameter of the row.setValue() method is supposed to be an object. Could that be the problem?Any help would be appreciated.Roy