I am having a difficult time understanding geometry as a concept accessed by the da module.
For example, I created a new feature class using the clip geoprocessing tool. I want to update the "HECTARES" field, as well as add a "Shape_Area" field that is updated with Shape@Area geometry.
This code will update my "HECTARES" field if I comment out the line
which leads me to believe that while row[1] remains empty, it still has access to the Shape@Area geometry.
Thanks.
For example, I created a new feature class using the clip geoprocessing tool. I want to update the "HECTARES" field, as well as add a "Shape_Area" field that is updated with Shape@Area geometry.
Code:
arcpy.Clip_analysis(fireLayer,refugeLayer,outLayer)
arcpy.AddField_management(outLayer,"Shape_Area", "DOUBLE")
updateRows = arcpy.da.UpdateCursor\
(outLayer,["HECTARES","Shape@Area"])
for row in updateRows: #fields --> 0:Hectares, 1:ShapeArea
HA = row[1]/10000 #Area in hectares
row[0] = HA #assign value to each row of Hectares
row[1] = ["Shape@Area"]
updateRows.updateRow(row) #save it by using the updateRow function
del updateRows # unlock cursor
del row #remove cursor pointerCode:
row[1] = ["Shape@Area"]Thanks.