"Everything is related to everything else, but near things are more related than distant things"
Perimeter and Area
The Python script determines the perimeter (in meters ) and area (in square meters ) of each of the individual islands of a multipart feature class.
# Ehsan Momeni
from arcpy import env, Describe, da, Polygon
env.workspace = r"C:\Users\emomeni\" # Shapefile sources
fc = "Hawaii.shp" # Input shapefile
SR = Describe(fc).spatialReference #spatial references
units = SR.linearUnitName # linear unit name
cursor = da.SearchCursor(fc, ["OID@", "SHAPE@"])
for OID, shape in cursor:
partnum = 0
for part in shape:
pn = Polygon(part, SR)
print "{}: Area:{} {}^2\tPerimeter:{} {}".format( partnum, pn.area, units, pn.length, units)
partnum += 1
print "\nTotal Area:{} {}^2".format(shape.area, units)