Intersect

URL:
https://<root>/Utilities/Geometry/GeometryServer/intersect
Methods:
GET
Version Introduced:
10.0

Description

The intersect operation is performed on a geometry service resource. This operation constructs the set-theoretic intersection between an array of geometries and another geometry. The dimension of each resultant geometry is the minimum dimension of the input geometry in the geometries array and the other geometry specified by the geometry parameter. This operation calls simplify on the input geometries and geometry. You can provide arguments to the intersect operation as query parameters defined in the following parameters table.

Request parameters

ParameterDetails

geometries

Specifies 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 ArcGIS REST API.

Syntax:

1
2
3
4
{
  "geometryType" : "<esriGeometryPoint | esriGeometryMultipoint | esriGeometryPolyline | esriGeometryPolygon>"
  "geometries" : [ <geometry1>, <geometry1>, ..., <geometryN> ]
}

Example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
  "geometryType" : "esriGeometryPolyline",
    "geometries" :
  [
    {
      "paths" :
      [
        [[-117,34],[-116,34],[-117,33]],
        [[-115,44],[-114,43],[-115,43]]
      ]
    },
    {
      "paths" :
      [
        [[32,17],[31,17],[30,17],[30,16]]
      ]
    }
  ]
}

geometry

Specifies a single geometry of any type with 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 ArcGIS REST API. The use of simple syntax is not supported.

Syntax:

1
2
3
4
{
  "geometryType" : "<esriGeometryPoint | esriGeometryMultipoint | esriGeometryPolyline | esriGeometryPolygon>"
  "geometry" : { <geometry1> }
}

Example

1
2
3
4
5
6
7
8
9
{
  "geometryType": "esriGeometryPolygon",
  "geometry": {
    "rings": [
      [[-117,34],[-116,34],[-117,33],[-117,34]],
      [[-115,44],[-114,43],[-115,43],[-115,44]]
    ]
  }
}

sr

Sets the well-known ID (WKID) or a spatial reference JSON object for the input geometries. For a list of valid WKID values, see Using spatial references.

f

The response format. The default response format is html.

Values: html | json | pjson

Example usage

The following is a decoded sample request URL (the actual URL must be encoded) for intersect that demonstrates how to calculate the intersection of two polygons:

https://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer/intersect?sr=4269&geometries={"geometryType":"esriGeometryPolygon","geometries":[{"rings":[[[-72,40],[-71,40],[-71,39],[-72,39],[-72,40]]]},{"rings":[[[-74,37],[-74,41],[-73,41],[-73,37],[-74,37]]]}]}&geometry={"geometryType":"esriGeometryPolygon","geometry":{"rings":[[[-75,39],[-74,40],[-73,39],[-72,40],[-71,39],[-71,38],[-75,38],[-75,39]]]}}

JSON Response syntax

1
2
3
4
{
  "geometryType" : "<esriGeometryPoint | esriGeometryMultipoint | esriGeometryPolyline | esriGeometryPolygon>"
  "geometries" : [ <geometry1>, <geometry1>, ..., <geometryN> ]
}

JSON Response example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{
 "geometryType": "esriGeometryPolygon",
 "geometries": [
  {"rings": [[
   [
    -70.99999999999994,
    39.00000000000006
   ],
   [
    -71.99999999999994,
    39.00000000000006
   ],
   [
    -71.99999999999994,
    40.00000000000006
   ],
   [
    -70.99999999999994,
    39.00000000000006
   ]
  ]]},
  {"rings": [[
   [
    -72.99999999999994,
    38.00000000000006
   ],
   [
    -73.99999999999994,
    38.00000000000006
   ],
   [
    -73.99999999999994,
    40.00000000000006
   ],
   [
    -72.99999999999994,
    39.00000000000006
   ],
   [
    -72.99999999999994,
    38.00000000000006
   ]
  ]]}
 ]
}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close