﻿ AccelerateForRelationalOperations Method (GeometryEngine)—ArcGIS Pro
ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Core.Geometry Namespace / GeometryEngine Class / AccelerateForRelationalOperations Method
A geometry to be accelerated.
Example

In This Topic
AccelerateForRelationalOperations Method (GeometryEngine)
In This Topic
Produces a copy of the given geometry that is an accelerated geometry used to speed up relational operations. Only polyline and polygon geometries can be accelerated. If the geometry cannot be accelerated, the method returns the same input geometry.
Syntax
```public Geometry AccelerateForRelationalOperations(
Geometry geometry
)```
```Public Function AccelerateForRelationalOperations( _
ByVal geometry As Geometry _
) As Geometry```

#### Parameters

geometry
A geometry to be accelerated.

#### Return Value

The accelerated geometry.
Remarks
Note that there is an overhead in setting up an accelerated geometry and that it takes more memory than a normal geometry. You should accelerate a geometry only if you are going to test many other geometries against it. For example you have a polygon and you want to determine if a large number of points intersect the polygon. Accelerate the polygon then loop through the points calling GeometryEngine.Intersects.

If the spatial reference of the geometry is an image coordinate system, then the geometry cannot be accelerated.

The relational operations that are affected by acceleration are Contains, Crosses, Disjoint, Disjoint3D, Equals(Geometry,Geometry), Intersects, Relate, Touches and Within.

Example
Accelerate Geometries
```// Use acceleration to speed up relational operations.  Accelerate your source geometry only if you are going to test many other geometries against it.
// Acceleration is applicable for polylines and polygons only. Note that accelerated geometries take more memory so if you aren't going to get any
// benefit from accelerating it, don't do it.

// The performance of the following GeometryEngine functions are the only ones which can be improved with an accelerated geometry.
//    GeometryEngine.Instance.Contains
//    GeometryEngine.Instance.Crosses
//    GeometryEngine.Instance.Disjoint
//    GeometryEngine.Instance.Disjoint3D
//    GeometryEngine.Instance.Equals
//    GeometryEngine.Instance.Intersects
//    GeometryEngine.Instance.Relate
//    GeometryEngine.Instance.Touches
//    GeometryEngine.Instance.Within

// methods need to run on the MCT
{
// accelerate the geometry to test
var acceleratedPoly = GeometryEngine.Instance.AccelerateForRelationalOperations(polygon);

// loop through all the geometries to test against
foreach (var testPolygon in testPolygons)
{
bool contains = GeometryEngine.Instance.Contains(acceleratedPoly, testPolygon);
bool within = GeometryEngine.Instance.Within(acceleratedPoly, testPolygon);
bool crosses = GeometryEngine.Instance.Crosses(acceleratedPoly, testPolygon);
}
});
```
Requirements

Target Platforms: Windows 11, Windows 10

ArcGIS Pro version: 3 or higher.