arcpy.AsShape() Concerns with .getArea() and .area

3560
2
Jump to solution
01-06-2016 08:03 AM
JamesCrandall
MVP Frequent Contributor

In an attempt to acquire the area of a polygon feature, I'm seeing some discrepancies between two methods and need some input.  In the code below, I'm acquiring what I think is the area in 2 distinctive ways (parea1 and parea2):

prjpolygon = polygon.projectAs(outSr)
parea1 = prjpolygon.getArea()
parea2 = prjpolygon.area

The result:

parea1 Sqfeet : 21767057.9882

parea2 Sqfeet : 26642367.0

Why do these return different values?  Which one do I use?

0 Kudos
1 Solution

Accepted Solutions
WesMiller
Regular Contributor III

You've probably already looked here Polygon—Help | ArcGIS for Desktop

area

(Read Only)

The area of a polygon feature. Empty for all other feature types.

Double
getArea ({type}, {units})

Returns the area of the feature using a measurement type.

View solution in original post

2 Replies
WesMiller
Regular Contributor III

You've probably already looked here Polygon—Help | ArcGIS for Desktop

area

(Read Only)

The area of a polygon feature. Empty for all other feature types.

Double
getArea ({type}, {units})

Returns the area of the feature using a measurement type.

JamesCrandall
MVP Frequent Contributor

Thank you!


I had to cycle thru the types (planar was the ticket) to get these to produce identical results:

prjpolygon = polygon.projectAs(outSr)
parea1 = prjpolygon.getArea('PLANAR','Feet')
parea2 = prjpolygon.area

print "\t parea1 Sqfeet : {} ".format(parea1)
print "\t parea2 Sqfeet : {} ".format(parea2)

Results:

parea1 Sqfeet : 26642367.0

parea2 Sqfeet : 26642367.0