Finds the areas and perimeters of an array of VEShapes or rings in a JSON-formatted object containing geometries.
Namespace:
ESRI.ArcGIS.VE(in ArcGISVE.exe)
Syntax
| JScript |
|---|
function AreasAndLengths( shapesOrGeometries : Object, callback : Function, distanceUnits : DistanceUnits, areaUnits : AreaUnits, WKID : String ) |
Parameters
- shapesOrGeometries
- Type: Object
Array of VEShapes or JSON-formatted object containing geometries to be measured.
- callback
- Type: Function
Function that will handle response. The callback function must take one argument, which will be a MeasureSet instance.
- distanceUnits
- Type: DistanceUnits
Type of distance units the distance result should be. Optional; defaults to meters for VEShapes. Ignored for JSON geometries.
- areaUnits
- Type: AreaUnits
Type of area units the area result should be. Optional; defaults to square meters for VEShapes. Ignored for JSON geometries.
- WKID
- Type: String
Well known ID of the spatial reference. Required for measurement of JSON geometries. Ignored for measurement of VEShapes
Remarks
Use this method to calculate the areas and perimeters of one or more polygons. The polygons can be either a set of VEShapes or a JSON object that contains geometries. If using VEShapes, you may specify the units for the returned perimeter measurement in DistanceUnits, and also the units for the returned area measurement in AreaUnits. You can also omit either parameter to accept the default of meters and square meters, respectively.
If using JSON geometries, you must specify the spatial reference identifier (WKID), since the JSON geometries can be in any coordinate system. The WKID can be specified with the numeric identifier, or you can use the SRUnitTypes enumeration. The distanceUnits parameter is ignored for JSON geometries (so may be set to null), because the returned measurements are in the units of the spatial reference, not necessarily meters.
For examples of using this function with both VEShapes and JSON geometries, see the "Work with Geometry" section of the Interactive SDK.
