# Class GeometryEngine

Performs geometric operations such as spatial relationship tests, reprojections, shape manipulations, topological query and analysis operations on Geometry objects.

**Namespace**: Esri.ArcGISRuntime.Geometry

**Assembly**: Esri.ArcGISRuntime.dll

##### Syntax

`public static class GeometryEngine`

**Remarks**

Capabilities include:

- Create new geometries from others with Buffer(Geometry, Double), Clip(Geometry, Envelope) and Union(Geometry, Geometry).
- Test spatial relationships between geometries such as Intersects(Geometry, Geometry) and Contains(Geometry, Geometry).
- Find the NearestCoordinate(Geometry, MapPoint) or NearestVertex(Geometry, MapPoint) between geometries.
- Reproject a geometry to another SpatialReference using Project(Geometry, SpatialReference).
- Calculate area and length using Area(Geometry) and Length(Geometry), or the geodetic equivalents (BufferGeodetic(Geometry, Double, LinearUnit, Double, GeodeticCurveType) and LengthGeodetic(Geometry, LinearUnit, GeodeticCurveType)) that account for the curvature of the earth.

GeometryEngine generally operates in two dimensions; operations do not account for z-values unless documented as such for a specific method (for example Project(Geometry, SpatialReference) transforms z-values in some cases).

Geodetic methods are better suited to data that have a geographic spatial reference (see IsGeographic, especially for large-area, small-scale use, while planar methods are suitable to data that have a projected coordinate system, especially for local, large-scale areas. Geodetic methods indicate this in the name, for example BufferGeodetic(Geometry, Double, LinearUnit, Double, GeodeticCurveType).

### Methods

Name | Description |
---|---|

Area(Geometry) | Gets the simple area for the Geometry passed in. This is a planar measurement using 2D Cartesian mathematics to compute the area. Use AreaGeodetic(Geometry, AreaUnit, GeodeticCurveType) for geodetic measurement. |

AreaGeodetic(Geometry, AreaUnit, GeodeticCurveType) | Gets the geodesic area of a polygon. |

AutoComplete(IEnumerable<Polygon>, IEnumerable<Polyline>) | Fills the closed gaps between polygons using polygon boundaries and polylines as the boundary for the new polygons. |

Boundary(Geometry) | Performs a boundary operation on a single geometry. For Point - returns an empty point. For Multipoint - returns an empty point. For Polyline - returns a multipoint. For Polygon - returns a polyline that bounds the polygon (adds all rings of the polygon to a polyline). |

Buffer(Geometry, Double) | Creates a buffer polygon at the specified distance around the given geometry. This is a planar buffer operation. Use BufferGeodetic(Geometry, Double, LinearUnit, Double, GeodeticCurveType) to produce geodetic buffers. |

Buffer(IEnumerable<Geometry>, IEnumerable<Double>, Boolean) | Creates and returns a buffer relative to the given geometries. This is a planar buffer operation. Use BufferGeodetic(Geometry, Double, LinearUnit, Double, GeodeticCurveType) to produce geodetic buffers. |

BufferGeodetic(Geometry, Double, LinearUnit, Double, GeodeticCurveType) | Calculates the geodesic buffer of a given geometry. |

BufferGeodetic(IEnumerable<Geometry>, IEnumerable<Double>, LinearUnit, Double, GeodeticCurveType, Boolean) | Calculates the geodesic buffer of the geometries in a given collection. |

Clip(Geometry, Envelope) | Constructs the polygon created by clipping geometry by envelope. |

CombineExtents(Geometry, Geometry) | Returns the envelope of the two given geometries. |

CombineExtents(IEnumerable<Geometry>) | Returns the envelope of geometries in the given collection. |

Contains(Geometry, Geometry) | Returns |

ConvexHull(Geometry) | Returns the minimum bounding geometry that completely encloses the given geometry. |

ConvexHull(IEnumerable<Geometry>, Boolean) | Returns the convex hull for the geometries in the given collection. |

CreatePointAlong(Polyline, Double) | Returns the point at the given distance along the line. |

Crosses(Geometry, Geometry) | Returns |

Cut(Geometry, Polyline) | Cut the 'geometry' with the 'cutter' |

Densify(Geometry, Double) | Densifies the input geometry by inserting additional vertices along the geometry at an interval
defined by |

DensifyGeodetic(Geometry, Double, LinearUnit, GeodeticCurveType) | Densifies the input geometry by creating additional vertices along the geometry, using a geodesic curve. |

Difference(Geometry, Geometry) | Constructs the set-theoretic difference between two geometries. |

Disjoint(Geometry, Geometry) | Returns |

Distance(Geometry, Geometry) | Measures the simple Euclidean distance between two geometries. This is a planar measurement using 2D Cartesian mathematics to calculate the distance in the same coordinate space as the inputs. Use DistanceGeodetic(MapPoint, MapPoint, LinearUnit, AngularUnit, GeodeticCurveType) for geodetic measurement. |

DistanceGeodetic(MapPoint, MapPoint, LinearUnit, AngularUnit, GeodeticCurveType) | Calculates the geodesic distance between 2 given points and calculates the azimuth at both points for the geodesic curve that connects the points. |

EllipseGeodesic(GeodesicEllipseParameters) | The function returns a piecewise approximation of a geodesic ellipse (or geodesic circle, if semiAxis1Length = semiAxis2Length). Constructs a geodesic ellipse centered on the specified point. If this method is used to generate a polygon or a polyline, the result may have more than one path, depending on the size of the ellipse and its position relative to the horizon of the coordinate system. When the method generates a polyline or a multipoint, the result vertices lie on the boundary of the ellipse. When a polygon is generated, the interior of the polygon is the interior of the ellipse, however the boundary of the polygon may contain segments from the spatial reference horizon, or from the GCS extent. |

Equals(Geometry, Geometry) | Tests if two geometries are equal (have equivalent spatial reference systems, same geometry type, and same points). |

Extend(Polyline, Polyline, GeometryExtendOptions) | Extends a polyline using a polyline as the extender. |

FractionAlong(Polyline, MapPoint, Double) | Finds the location on the line nearest the point, expressed as the fraction along the line's total geodesic length, if the point is within the specified distance from the closest location on the line. The line and point must have consistent spatial references. |

Generalize(Geometry, Double, Boolean) | Generalizes the given geometry by removing vertices based on the Douglas-Poiker algorithm. |

Intersection(Geometry, Geometry) | Constructs the set-theoretic intersection between two geometries. |

Intersections(Geometry, Geometry) | Calculates the intersection of two geometries. |

Intersects(Geometry, Geometry) | Returns |

IsSimple(Geometry) | Gets a value indicating whether or not the geometry is simple. |

LabelPoint(Polygon) | Calculates an interior point for the given polygon. This point can be used by clients to place a label for the polygon. |

Length(Geometry) | Gets the length for a specified Geometry. This is a planar measurement using 2D Cartesian mathematics to compute the length in the same coordinate space as the inputs. Use LengthGeodetic(Geometry, LinearUnit, GeodeticCurveType) for geodetic measurement. |

LengthGeodetic(Geometry, LinearUnit, GeodeticCurveType) | Gets the geodesic length for the Geometry passed in. |

MoveGeodetic(IEnumerable<MapPoint>, Double, LinearUnit, Double, AngularUnit, GeodeticCurveType) | Moves each map point in the read-only collection by a geodesic distance. |

NearestCoordinate(Geometry, MapPoint) | Determines the nearest point in the input geometry to the input point using a simple planar measurement. |

NearestCoordinateGeodetic(Geometry, MapPoint, Double, LinearUnit) | Determines the nearest point in the input geometry to the input point, by using a shape preserving geodesic approximation of the input geometry. |

NearestVertex(Geometry, MapPoint) | Returns a ProximityResult that describes the nearest vertex in the input geometry to the input point. |

NormalizeCentralMeridian(Geometry) | Folds the geometry into a range of 360 degrees. This may be necessary when wrap around is enabled on the map. If Geometry is an Envelope then a Polygon will be returned unless the Envelope is empty then and Empty Envelope will be returned. |

Offset(Geometry, Double, OffsetType, Double, Double) | Returns offset version of the input geometry. |

Overlaps(Geometry, Geometry) | Returns |

Project(Geometry, SpatialReference) | Projects the given geometry from its current spatial reference system into the given spatial reference system. |

Project(Geometry, SpatialReference, DatumTransformation) | Projects the given geometry from its current spatial reference system into the given output spatial reference system, applying the datum transformation provided. |

Relate(Geometry, Geometry, String) | Compares the spatial relationship of two geometries. Can compare Interior, Boundary and Exterior of two geometries based on a DE-9IM encoded string. This must be 9 characters long and contain combinations only of these characters: TF*012 |

RemoveM(Geometry) | Return a copy of the given geometry with its m-values removed. |

RemoveZ(Geometry) | Return a copy of the given geometry with its z-coordinate removed. |

RemoveZAndM(Geometry) | Return a copy of the given geometry with its z-coordinate and m-values removed. |

Reshape(Multipart, Polyline) | Reshapes the specified geometry. |

SectorGeodesic(GeodesicSectorParameters) | The function returns a piecewise approximation of a geodesic sector. If this method is used to generate a polygon or a polyline, the result may have more than one path, depending on the size of the sector and its position relative to the horizon of the coordinate system. When the method generates a polyline or a multipoint, the result vertices lie on the boundary of the ellipse. When a polygon is generated, the interior of the polygon is the interior of the sector, however the boundary of the polygon may contain segments from the spatial reference horizon, or from the GCS extent. |

SetM(Geometry, Double) | Return a copy of a geometry with the supplied M value. |

SetZ(Geometry, Double) | Return a copy of a geometry with the supplied z-coordinate. |

SetZAndM(Geometry, Double, Double) | Return a copy of a geometry with the supplied z-coordinate and m-value. |

Simplify(Geometry) | Simplifies the given geometry to make it topologically consistent according to its geometry type. |

SymmetricDifference(Geometry, Geometry) | Performs the Symmetric difference operation on the two geometries. |

Touches(Geometry, Geometry) | Returns |

Union(Geometry, Geometry) | The union operation constructs the set-theoretic union of the geometries in the input array. |

Union(IEnumerable<Geometry>) | Calculates the union of a collection of geometries |

Within(Geometry, Geometry) | Returns |

### Applies to

Target | Versions |
---|---|

.NET Standard 2.0 | 100.3 - 100.15 |

.NET 6.0 | 100.13 - 100.15 |

.NET 6.0 Windows | 100.13 - 100.15 |

.NET Framework | 100.0 - 100.15 |

.NET 5 | 100.10 - 100.12 |

.NET Core 3.1 | 100.7 - 100.12 |

Xamarin.Android | 100.0 - 100.15 |

Xamarin.iOS | 100.0 - 100.15 |

UWP | 100.0 - 100.15 |