

This complex expression gets the individual parts of a multipart polygon, retrieves their areas, stores them in a Python list via a list comprehension, sorts the list, then takes the last (i.e. If the polygon has only one part, it returns the area of that part. sorted() returns the area of the largest part within a polygon.The area can be calculated in other units and with other measurement types, as discussed in the in my detailed post about geodesic areas. This accurate area calculation can be performed on feature classes in geographic coordinate systems (i.e. !SHAPE!.getArea("GEODESIC","SQUAREKILOMETERS") returns the geodesic area of a polygon feature in square kilometers.The area can be calculated in other units, identical to the Calculate Geometry tool in the attribute table. !SHAPE!.getArea("PLANAR","SQUAREKILOMETERS") returns the area of a polygon feature projected onto a two-dimensional plane in square kilometers.This is identical to the SHAPE_Area field automatically added in geodatabase feature classes. The units are the square of the feature’s coordinate system’s linear units. !SHAPE!.area returns the planar area of a polygon feature in the feature’s coordinate system as a floating point number.The length can be calculated in other units and with other measurement types, as discussed in my detailed post about geodesic areas. This accurate length calculation can be performed on feature classes in geographic coordinate systems (i.e. !SHAPE!.getLength("GEODESIC","KILOMETERS") returns the geodesic length of a line feature or the geodesic perimeter of a polygon feature in kilometers.!SHAPE!.getLength("PLANAR","KILOMETERS") returns the planar length of a line feature or the planar perimieter of a polygon feature in kilometers.This is identical to the SHAPE_Length field automatically added in geodatabase feature classes. !SHAPE!.length returns the planar length of a line feature or the planar perimeter of a polygon feature. The units are the feature’s coordinate system’s linear units.Passing in False for the boolean parameter will return the point at a horizontal distance along the line rather than a fraction of the line. For example, !SHAPE!.positionAlongLine(0.2, True) returns the point one-fifth of the length from the start of the feature to the end of the feature. To get the coordinates for the point at another fraction along the line, replace 0.5 with a value between 0.0 and 1.0. !SHAPE!.positionAlongLine(0.5,True).firstPoint.X and !SHAPE!.positionAlongLine(0.5,True).firstPoint.Y return the longitude and latitude coordinates of the midpoint of the feature as floating point numbers.This is identical to the true centroid above, unless that point is outside of the feature in which case the label point is returned. !SHAPE!.centroid.X and !SHAPE!.centroid.Y return the longitude and latitude coordinates of the centroid of the feature as floating point numbers.

The label point always lies within the feature, even when concave. !SHAPE!.labelPoint.X and !SHAPE!.labelPoint.Y return the longitude and latitude coordinates of the label point of the feature as floating point numbers.

a horseshoe) this point can lie outside of the feature.
