Geometry Service GetAreasAndLengths2 method

Calculates area and perimeter length for each polygon, allowing specification of output units.

 

GetAreasAndLengths2(SpatialReference SpatialReference,  Polygon[] InPolygonArray,  LinearUnit LengthUnit,  LinearUnit AreaUnit,  esriAreaUnits AreaUnitEnum)

 

Parameter

Description

SpatialReference

The spatial reference of the geometries in the InPolygonArray. Cannot be null.

InPolygonArray

The array of Polygons on which area and boundary length will be calculated (on each Polygon). All geometries are assumed to be in the coordinate system defined by the input SpatialReference.

LengthUnit

(Optional) Output lengths are expressed in this unit of measure.

AreaUnit

(Optional) Output areas are expressed in this (squared) unit of measure.

AreaUnitsEnum

(Optional) Output areas are expressed in this unit of measure. Some units (such as acres) can be specified by using this parameter instead of the "AreaUnit", which is always a squared linear unit.

Lengths

An array of double values containing the boundary length (perimeter) for each Polygon in the input array.  The variable is populated when this method is called.

 

Return Value

 

An array of double values (double[]) containing the boundary length (perimeter) for each Polygon in the input array.

 

Remarks

 

The area and length values are computed in the units specified as input parameters. If LengthUnit is not specified, then lengths are reported in the units of the input spatial reference.

 

If AreaUnit is not specified (i.e. its nil) then AreaUnitEnum is used if its value is other than esriAreaUnitsUnknown, otherwise the (squared) units of the input spatial reference are used.

 

It is not recommended that this method be used on geometries having latitude-longitude coordinates. You can use the GetLengthsGeodesic method to compute accurate lengths for polylines with latitude-longitude coordinates.