Difference

The “difference” operation allows to remotely calculate, following the set-theoretic of an array of geometries specified by the user, which does not belong to a geometry, also indicated by the user.

The following illustrations show the result of this operation. The red (lines and points) and blue (polygons) elements are the result of applying their initial geometries (all excepting the green circle, ‘geometries’ parameter), the difference in the content of the green circle (‘geometry’ parameter).

Example of request:

http://galileo.icc.cat/arcgis/rest/services/Utilities/Geometry/GeometryServer/difference?sr=25831&geometries={"geometryType":"esriGeometryPolygon","geometries":[{"rings":[[[418000,4584800],[418000,4585000],[418500,4585000],[418500,4585000],[418000,4584800]]]},{"rings":[[[420000,4594800],[420000,4595000],[420500,4595000],[420500,4595000],[420000,4594800]]]}]}&geometry={"geometryType":"esriGeometryPolygon","geometry":{"rings":[[[418000,4584800],[418000,4585000],[418500,4585000],[418500,4585000],[418000,4584800]]]}}&f=json&token=WgTR74xQdSvkHVECel6pSEijFKWafsP3g9DLA8WYg1sD3ycDBOx4g-Vj_i4xHhus

and related response:

{
  "geometryType": "esriGeometryPolygon",
  "geometries": [
   {"rings": []},
    {"rings": [[
     [420500,4595000],[420000,4594800],[420000,4595000],[420500,4595000]
   ]]}
   ]
}

Service parameters

Parameter

Description

f

Response format

Valid values: html | json
Default value: html

geometries

Array of geometries of which the difference with the geometry specified at the “geometry” parameter is wanted to be calculated.  The syntax of this parameter should be:

{
"geometryType" : ""
"geometries" : [ , ]
}

geometry

Geometry of any type, which dimension is equal to or greater than the elements listed at the “geometries” parameter. The syntax of this parameter should be:

{
"geometryType" : "",
"geometry" :
}

sr

Reference system identifier used to describe geometries.

token

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

Additional information

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=vex2E3A3zz0seJnGIu6_g-IEO9PBLf4z6wwgxuK_Inoqhc8qnHkVX4Abh600wo7_0w-wi0IM2DhRXYa5X8wdcQvDYmZRF04G8gG73MFx86cFhNWkKcuhn6bUL7a8GzPGIIxYSm6vLtyP0_JJ5fiSM5RDQ7fZtQ_HWxeANZPmndHM9w-Nohb5i4GZCbmyRZe-KgES_IIvuEt9v_sSEZzwtQ..