This document is archived and information here might be outdated. Recommended version. |
ArcObjects Help for .NET developers > ArcObjects namespaces > Geometry > ESRI.ArcGIS.Geometry > Interfaces > IG > IGeometryServer2 Interface > IGeometryServer2.GetAreasAndLengths2 Method (ArcObjects .NET 10.5 SDK) |
Calculates areas and perimeter lengths for each polygon in the specified array. Optionally does unit conversion.
[Visual Basic .NET] Public Sub GetAreasAndLengths2 ( _ ByVal pSR As ISpatialReference, _ ByVal pInPolygons As IPolygonArray, _ ByVal pLengthUnit As ILinearUnit, _ ByVal pAreaUnit As ILinearUnit, _ ByVal areaUnitEnum As esriAreaUnits, _ ByRef ppAreas As IDoubleArray, _ ByRef ppLengths As IDoubleArray _ )
[C#] public void GetAreasAndLengths2 ( ISpatialReference pSR, IPolygonArray pInPolygons, ILinearUnit pLengthUnit, ILinearUnit pAreaUnit, esriAreaUnits areaUnitEnum, ref IDoubleArray ppAreas, ref IDoubleArray ppLengths );
[C++]
HRESULT GetAreasAndLengths2(
ISpatialReference* pSR,
IPolygonArray* pInPolygons,
ILinearUnit* pLengthUnit,
ILinearUnit* pAreaUnit,
esriAreaUnits areaUnitEnum,
IDoubleArray** ppAreas,
IDoubleArray** ppLengths
);
[C++]
Parameters pSR
pSR is a parameter of type ISpatialReference pInPolygons
pInPolygons is a parameter of type IPolygonArray pLengthUnit
pLengthUnit is a parameter of type ILinearUnit pAreaUnit
pAreaUnit is a parameter of type ILinearUnit areaUnitEnum
areaUnitEnum is a parameter of type esriAreaUnits ppAreas [out]
ppAreas is a parameter of type IDoubleArray ppLengths [out]
ppLengths is a parameter of type IDoubleArray
The area and length values are computed in the units specified as input parameters, if they are present, otherwise they are computed in the units of the spatial reference. 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.