Geometric calculation

Perform different geometric calculations on two geometries.

What is a geometry calculation analysis?

A geometry calculation analysis is the process of using operations such as buffer, intersect, union, and nearest to create a new output geometry. The resulting geometry is commonly displayed as a shape on a map or used as input for another analysis. To execute the analysis, you can use ArcGIS Maps SDK for JavaScript, ArcGIS Maps SDKs for Native Apps, or ArcGIS API for Python. See the code examples below.

You can use geometry calculations to:

  • Buffer points, lines, and polygons.
  • Intersect two or more geometries of the same type.
  • Union two or more geometries of the same type.
  • Find the closest coordinate.
  • Split a geometry into multiple geometries.
  • Add vertices or densify a geometry.
  • Simplify or correct a geometry.

How to calculate geometries

To perform a calculation on a geometry you typically:

  1. Create one or more geometries.
  2. Perform the operation.

Types of calculations

Below is a list of common operations supported by most ArcGIS client APIs. For specific details about how to use the operations, see the examples below.

The table below includes some of the most popular operations for performing geometric calculations. Most operations return a measurement value or a new geometry. Multipoint, multipolyline, and multipolygon geometry types are also supported.

OperationDescription
Example
BoundaryReturns a polyline or polygon for the area of a geometry.
BufferReturns a polygon that surrounds a geometry at a specified distance.
ClipReturns a geometry where a target geometry and envelope intersect.
Convex HullReturns a polygon with the shortest perimeter that encloses one or more geometries.
CutReturns geometries where an input polyline crosses an existing geometry.
DensifyReturns a geometry that has intermediate points at a specified distance between existing vertices.
DifferenceReturns one or more geometries that are the result of the set theoretic difference between one geometry and another geometry.
ExtentReturns a rectangle geometry that encompasses the coordinates of an input geometry.
GeneralizeReturns a geometry where the vertices that contribute least to the shape of the input polygon or polyline are removed, while retaining the characteristics of the shape. The number of vertices removed depends on a given spatial deviation distance
IntersectReturns a geometry based on set theoretic intersection of the input geometries.
Nearest CoordinateReturns the coordinate of a geometry that is closest to a specified point.
Nearest VertexReturns the vertex of a geometry that is closest to a specified point.
OffsetReturns a geometry that is a constant distance from an input polyline or polygon.
ReshapeReturns a geometry that takes the shape of the reshaper input where the reshaper geometry intersects the input geometry.
SimplifyReturns a geometry that is topologically correct.
TrimReturns a geometry that intersects the input geometry and trim polyline.
UnionReturns a geometry based on the set theoretic union of the input geometries.

Code examples

Buffer

Create 1000 meter buffers around different types of geometry.

ArcGIS Maps SDK for JavaScriptArcGIS Maps SDK for JavaScriptArcGIS Maps SDK for .NETArcGIS Maps SDK for KotlinArcGIS Maps SDK for SwiftArcGIS Maps SDK for JavaArcGIS Maps SDK for QtArcGIS 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
          const bufferGeometry = geometryEngine.geodesicBuffer(
            geometry,
            2000,
            "meters"
          );
          console.log("The buffer geometry is:" + bufferGeometry);

Intersect

Intersect two geometries.

ArcGIS Maps SDK for JavaScriptArcGIS Maps SDK for JavaScriptArcGIS Maps SDK for .NETArcGIS Maps SDK for KotlinArcGIS Maps SDK for SwiftArcGIS Maps SDK for JavaArcGIS Maps SDK for QtArcGIS 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
        const intersectGeometry = geometryEngine.intersect(polygon1, polygon2);
        console.log("The intersected geometry is:" + intersectGeometry);

Union

Union two geometries.

ArcGIS Maps SDK for JavaScriptArcGIS Maps SDK for JavaScriptArcGIS Maps SDK for .NETArcGIS Maps SDK for KotlinArcGIS Maps SDK for SwiftArcGIS Maps SDK for JavaArcGIS Maps SDK for QtArcGIS 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
        const unionGeometry = geometryEngine.union(polygon1, polygon2);
        console.log("The union geometry is:" + unionGeometry);

Nearest

Find the vertex in a polygon that is closest to each point. In this case, the polygon is a buffer created from a line. It contains many vertices.

ArcGIS Maps SDK for JavaScriptArcGIS Maps SDK for JavaScriptArcGIS Maps SDK for .NETArcGIS Maps SDK for KotlinArcGIS Maps SDK for SwiftArcGIS Maps SDK for JavaArcGIS Maps SDK for QtArcGIS 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
            const nearestGeometry = geometryEngine.nearestVertex(bufferGeometry, geometry);
            console.log("The nearestGeometry geometry is:" + nearestGeometry);

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