• Imprimeix

Distance

The “distance” operation allows to calculate planar or geodesic distance, between two geometries specified by the user.

Example of request:

http://galileo.icc.cat/arcgis/rest/services/Utilities/Geometry/GeometryServer/distance?sr=25831&geometry1={"geometryType":"esriGeometryPolyline","geometry":{"paths":[[[417800,4584900],[418600,45884900]]]}}&geometry2={"geometryType":"esriGeometryPolygon","geometry":{"rings":[[[418000,4584800],[418000,4585000],[418500,4585000],[418500,4585000],[418000,4584800]]]}}&geodesic=false&distanceUnit=9036&f=json&token=WgTR74xQdSvkHVECel6pSEijFKWafsP3g9DLA8WYg1sD3ycDBOx4g-Vj_i4xHhus

Related response:

{"distance": 199.99806291642642}

SErvice parameters

Parameter

Description

f

Response format

Valid values: html | json
Default value: html

geometry1

Geometry from which the distance is measured. The syntax of this parameter should be:

{
"geometryType" : "<esriGeometryPoint | esriGeometryPolyline | esriGeometryEnvelope | esriGeometryPolygon | esriGeometryMultipoint>",
"geometry" : <geometry1>
}

geometry2

Geometry to which the distance is measured. The syntax of this parameter should be:

{
"geometryType" : "<esriGeometryPoint | esriGeometryPolyline | esriGeometryEnvelope | esriGeometryPolygon | esriGeometryMultipoint>",
"geometry" : <geometry1>
}

sr

Reference system identifier used to describe geometries.

distanceUnit

Distance unit used to represent the resulting distance. See the list of possible values

geodesic

A flag that has to be equal to “true” if the geodesic distance is wanted to be calculated. Otherwise, the planar distance is calculated.

Valid values: true | false

Default values: false

token

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

Additional information