Python help for math calculation (division)

2871
3
Jump to solution
07-20-2015 08:49 AM
CrystalCowardin
New Contributor III

I'm very new to Python and am working in model builder right now.  I created a new field (Shp_Acs) and I want that field to calculate the area of the polygon in acres. I tried !shape.area@ACRES! and it doesn't bring back the correct value. 

I was using VB and the expression was [SHAPE_STAr] /43560.  SHAPE_STAr is a field in my table that has the area of the polygon in sq.ft.

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
DarrenWiens2
MVP Honored Contributor

What is the data type of the field you are attempting to calculate into?

Also, is your feature class projected? From the field calculator help, regarding area tokens:

Using areal units on geographic data will yield questionable results as decimal degrees are not consistent across the globe.

View solution in original post

3 Replies
IanMurray
Frequent Contributor

I used !shape.area@acres! and it returned the proper acreage for my polygon features. 

DarrenWiens2
MVP Honored Contributor

What is the data type of the field you are attempting to calculate into?

Also, is your feature class projected? From the field calculator help, regarding area tokens:

Using areal units on geographic data will yield questionable results as decimal degrees are not consistent across the globe.

CrystalCowardin
New Contributor III

It's a double field.

I tried what you wrote above and it worked!  Thanks!

0 Kudos