Parameters
- geometry
- A geometry to be accelerated.
Return Value
The accelerated geometry.
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.
// 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 ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() => { // 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); } });
Target Platforms: Windows 11, Windows 10