Calculation of Areas and Lengths

The “areasAndLengths” operation, allows to remotely calculate the area and perimeter of polygons specified by the user.

Example of request:

http://galileo.icc.cat/arcgis/rest/services/Utilities/Geometry/GeometryServer/areasAndLengths?f=json&polygons=[%7B%22rings%22:[[[414376.17200000025,4592771.638499999],[413336.32830000017,4592737.263499999],[412932.42200000025,4592943.513499999],[412666.01580000017,4593476.325999999],[412726.17200000025,4593983.3572],[413087.10950000025,4594275.5447],[413559.76580000017,4594404.450999999],[413645.70330000017,4594404.450999999],[414702.73450000025,4593957.575999999],[414702.73450000025,4593948.9822],[414376.17200000025,4592771.638499999]]],%22spatialReference%22:%7B%22wkid%22:25831%7D%7D]&sr=25831&lengthUnit=9036&areaUnit=%7B%22areaUnit%22:%22esriHectares%22%7D&token= 5ZLZf5wlKWNKQaknwGfPfLCUXaEf1WIEPXVF9C5ERx3acNrlpdI-rFj0dafBlf2U

and related response:

{"areas":[260.02001497661342],"lengths":[6.018457343510268]}

Service parameters:

Parameter

Description

f

Response format

Valid values: html | json
Default value: html

polygons

Array of polygons of which the area and perimeter are wanted to be calculated. The syntax of this parameter should be:

[, ]

sr

Reference system identifier used to describe polygons.

lengthUnit

Unity in which the polygons perimeter is desired. See the list of possible values

areaUnit

Unity in which the area of polygons should be expressed. Vegeu els valors possibles

calculationType 

Type of calculation performer to determine the area and perimeter.

Valids values: planar | geodesic | preserveShape.
Default value: preserveShape

planar: calculation that express geometries such as polygons on a flat surface

geodesic: calculations based on the vertices of the polygon, defining the lines between them as geodetic segment  (shorter lines between two points on the Earth ellipsoid) independent of the specific polygon forms.

preserveShape: calculation expressing geometries (vertices and lines between them) on the Earth ellipsoid surface.

token

Required security key in order to perform this function which is generated by filling in the corresponding form.

Additional information

Example Usage