FRAMES | NO FRAMES | Description | Parameters | Examples | Response |
URL | http://<geometryservice-url>/difference |
---|---|
Parent Resource | Geometry Service |
The difference operation is performed on a geometry service resource. This operation constructs the set-theoretic difference between an array of geometries and another geometry.
From 10.1 onwards this operation will call Simplify on the input geometries
and geometry
.
You can provide arguments to the difference operation as query parameters defined in the parameters table below.
Parameter | Details |
---|---|
f | Description: 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 same as the structure of the
json geometry objects
returned by the ArcGIS REST API. Syntax and Examples: JSON Structures:Syntax:{ { "geometryType" : "esriGeometryPolyline", "geometries" : [ { "paths" : [ [[-117,34],[-116,34],[-117,33]], [[-115,44],[-114,43],[-115,43]] ] }, { "paths" : [ [[32.49,17.83],[31.96,17.59],[30.87,17.01],[30.11,16.86]] ] } ] } |
geometry | Description: A single geometry of any type, of
dimension equal to or greater than the elements of "geometries". The structure
of geometry is same as the structure of the JSON
geometry objects returned by the ArcGIS REST API. The use of simple syntax
is not supported. Syntax and Examples: JSON Structures:Syntax:{ { |
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 1: Calculate Difference between two polygons
http://sampleserver3.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer/difference?{
"geometryType" : "<esriGeometryPoint | esriGeometryMultipoint | esriGeometryPolyline | esriGeometryPolygon >"
"geometries" : [ <geometry1>, <geometry2> ]
}
{ "geometryType" : "esriGeometryPolygon", "geometries" : [ { "rings" : [ [ [-74.738824727, 40.1777256440001], [-74.916654342, 39.1706385420001], [-75.014407077, 39.198363837], [-75.1199581119999, 39.184691781], [-75.415672275, 39.374971842], [-75.5527630399999, 39.4905143070001], [-75.516688884, 39.5665684160001], [-75.570234187, 39.617734963], [-75.489280661, 39.7148582190001], [-75.475974268, 39.7200843840001], [-75.474768457, 39.741832093], [-75.4603941189999, 39.763362027], [-74.738824727, 40.1777256440001] ] ] } ] }