Quantcast
Channel: Question and Answer » modelbuilder
Viewing all articles
Browse latest Browse all 135

Thiessen Polygon Total Area Calculations Model Builder/Python Code

$
0
0

I am attempting to create a tool using Model Builder (and Python code) for calculating the average annual precipitation of a study area using the Thiessen Polygon Method. My model runs good other than finding the total area of the study area for further calculations in my model. Here is a sample of my code extracting the total area. I attempting to just use Summary Statistics to find the total area but I don’t know how to access that table for input into further calculations.

def MySub (TotalArea1) :

 TotalArea = 0.0
 cursor = arcpy.SearchCursor(feat)
 for row in cursor:
    TotalArea += row.getValue("POLY_AREA")
 del row
 del cursor

 cursor = arcpy.UpdateCursor(feat)
 for row in cursor:
    row.setValue("TotArea", TotalArea)
    cursor.updateRow(row)
 del row
 del cursor

Viewing all articles
Browse latest Browse all 135

Trending Articles