How to perform geometry analysis

1. Select an operation

The first step to performing a geometry analysis is to select an operation. Operations are categorized into the following groups based on the functionality they provide:

2. Create geometries

After you have selected the operation, the next step is to create one or more geometries with the same spatial reference. Geometry data is typically created through user interaction or by accessing features in a hosted feature layer.

In general, There are two different ways to create geometry data for analysis:

Below is an example of creating geometries programmatically using coordinates:

ArcGIS Maps SDK for JavaScriptArcGIS Maps SDK for JavaScriptArcGIS API for Python
Use dark colors for code blocksCopy
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
46
47
48
49
  // Create a point
  const point = new EsriPoint({
    type: "point",
    x: -118.8065,
    y: 34.0005,
    spatialReference: EsriSpatialReference.WGS84
  });

  // create a polyline
  const line = new EsriPolyline({
    type: "polyline",
    paths: [
      [-118.8215, 34.0139], //Longitude, latitude
      [-118.8148, 34.008], //Longitude, latitude
      [-118.8088, 34.0016], //Longitude, latitude
    ],
    spatialReference: EsriSpatialReference.WGS84,

3. Perform the analysis

After you have created geometries, you can use them as parameters to one or more geometric operations.

The example below demonstrates how to pass the created geometries to client API operations:

ArcGIS Maps SDK for JavaScriptArcGIS Maps SDK for JavaScriptArcGIS API for Python
Expand
Use dark colors for code blocksCopy
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
46
47
48
49
  // Buffer the input point
  const buffer = EsriGeodesicBufferOperator.execute(point, 1000)

  // Get the geodetic area of the new buffer
  const area = EsriGeodeticAreaOperator.execute(buffer)
  console.log(`The area is: ${area}`)

  // Determine if the buffer area and polyline intersect
  const intersects = EsriIntersectsOperator.execute(buffer, line)
  console.log(`The geometries intersect: ${intersects}`)

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