Difference
- URL:http:// <geometryservice-url>/difference
- Version Introduced:10.0
Description
The difference operation is performed on a geometry service resource. This operation constructs the set-theoretic difference between each element of an array of geometries and another geometry, the so-called difference geometry. In other words, let B be the difference geometry. For each geometry, A, in the input geometry array, it constructs A - B.
At 10.1 and later, this operation calls simplify on the input geometries and geometry.
You can provide arguments to the difference operation as query parameters defined in the following parameters table:
Request parameters
Parameter |
Details |
---|---|
f |
Description: (Optional) The response format. The default response format is html. Values: html | json |
geometries |
Description: An array of points, multipoints, polylines or polygons. The structure of each geometry in the array is the same as the structure of the JSON geometry objects returned by the ArcGIS REST API. JSON structures: Syntax:
Example:
|
geometry |
Description: A single geometry of any type and of a dimension equal to or greater than the elements of geometries. The structure of geometry is the same as the structure of the JSON geometry objects returned by the ArcGIS REST API. The use of simple syntax is not supported. JSON structures: Syntax:
Example:
|
sr |
Description: The well-known ID of the spatial reference or a spatial reference JSON object for the input geometries. For a list of valid WKID values, see Projected coordinate systems and Geographic coordinate systems. |
Example usage
This example constructs the difference between polygons.
JSON response syntax
{"geometryType" : "<esriGeometryPoint | esriGeometryMultipoint | esriGeometryPolyline | esriGeometryPolygon >""geometries" : [ <geometry1>, <geometry2> ]}
JSON response example
{
"geometryType": "esriGeometryPolygon",
"geometries": [
{
"rings": [
[
[
-74.899999999999977,
39.200000000000045
],
[
-75.099999999999966,
39.10000000000008
],
[
-75.499999999999943,
39.700000000000045
],
[
-74.699999999999989,
40.200000000000045
],
[
-74.770833332999985,
39.84583333300003
],
[
-74.999999999999943,
39.800000000000068
],
[
-74.833333332999985,
39.53333333300003
],
[
-74.899999999999977,
39.200000000000045
]
]
]
},
{
"rings": [
]
}
]
}