ArcGIS Runtime SDK for macOS
100.5

This class can perform geometric operations such as spatial relationship tests, reprojections, shape manipulations, and topological query and analysis operations.
The class contains static methods that operate on geometries. The types of operations that can be performed include the following 
Some operations use geodesic line interpolation rather than planar (Cartesian). Those that use geodesic line interpolation are specified in their descriptions. A geodesic line follows the shortest distance between two points on the Earth's surface when Earth's surface is approximated by a spheroid. When geodesic line interpolation is used, measurements of distance, area and azimuth are accurate with respect to the curved surface of the spheroid.
+ (double) areaOfGeometry:  (AGSGeometry *)  geometry 
Gets the simple area for the AGSGeometry passed in. This is a planar measurement using 2D Cartesian mathematics to compute the area.
The geometry must be topologically correct to get its accurate legth. Geometries returned by ArcGIS Server services are always correct. If you construct geometries programmatically or using the sketch layer, or if you modify geometries returned by ArcGIS Server, you should simplify them using simplifyGeometry:
geometry  The geometry to calculate the area for. 
+ (nullable NSArray<AGSPolygon*>*) autoCompleteForExistingBoundaries:  (NSArray< AGSGeometry * > *)  existingBoundaries  
newBoundaries:  (NSArray< AGSPolyline * > *)  newBoundaries  
Fills the closed gaps between polygons using polygon boundaries and polylines as the boundary for the new polygons.
The new polygons are created in the closed empty areas bounded by the edges of the existing polygon boundaries and the new boundary polylines. The newly created polygons do not overlap any existing polygons or polylines, and the boundary of a new polygon must contain at least one edge from the polylines. Only polygons that intersect the input polylines will participate in the operation, so it makes sense to prefilter the input accordingly. The geometries in existingBoundaries must all have an area, i.e. be polygons or envelopes. The geometries in newBoundaries must all be polylines. The geometries in existingBoundaries and newBoundaries must have consistent spatial references.
existingBoundaries  The polygons 
newBoundaries  The polylines 
existingBoundaries
or newBoundaries
is empty, returns an empty array. Returns nil on error. + (nullable NSArray<AGSGeometry*>*) bufferGeometries:  (NSArray< AGSGeometry * > *)  geometries  
distances:  (NSArray< NSNumber * > *)  distances  
unionResults:  (BOOL)  unionResults  
Creates and returns a buffer around the given geometries.
The geometries must have consistent spatial references.
geometries  A collection of geometries. 
distances  The distance (in the unit of the geometry's spatial reference) to buffer each geometry, expressed as an NSArray of NSNumbers (doubles). If the size of the distances array is less than the number of geometries, the last distance value is used for the rest of geometries. 
unionResults  Return a single geometry that buffers all the geometries (YES), or one buffer for each in the given collection (NO). 
unionResult
is true, there will be only a single polygon in the resulting collection. If geometries is empty, returns an empty array. Returns nil on error. + (nullable AGSPolygon*) bufferGeometry:  (AGSGeometry *)  geometry  
byDistance:  (double)  distance  
Creates a buffer polygon at the specified distance around the given geometry.
geometry  Specifies the input geometry. 
distance  The distance (in the unit of the geometry's spatial reference) by which to buffer the geometry. 
AGSUnit::convert:fromUnit:
and AGSUnit::convert:toUnit:
to convert values between different units + (nullable AGSGeometry*) clipGeometry:  (AGSGeometry *)  geometry  
withEnvelope:  (AGSEnvelope *)  envelope  
Constructs the polygon created by clipping geometry by envelope.
geometry  The geometry to be clipped by the given envelope. 
envelope  The envelope in which to use in order to clip geometry. 
+ (nullable AGSEnvelope*) combineExtentsOfGeometries:  (NSArray< AGSGeometry * > *)  geometries 
Returns the combined envelope of geometries in the given array.
The geometries must have consistent spatial references.
geometries  An NSArray of geometries. 
+ (nullable AGSEnvelope*) combineExtentsOfGeometry:  (AGSGeometry *)  geometry1  
andGeometry:  (AGSGeometry *)  geometry2  
Returns the combined envelope of the two given geometries.
The given geometries must have consistent spatial references.
geometry1  A geometry object. 
geometry2  Another geometry object. 
+ (nullable NSArray<AGSGeometry*>*) convexHullForGeometries:  (NSArray< AGSGeometry * > *)  geometries  
mergeInputs:  (BOOL)  mergeInputs  
Returns the convex hull for the geometries in the given array.
The geometries must have consistent spatial references.
geometries  An NSArray of geometries. 
mergeInputs  Return a single geometry that encloses all the geometries (YES), or one enclosing geometry for each in the collection (NO). 
+ (nullable AGSGeometry*) convexHullForGeometry:  (AGSGeometry *)  geometry 
Returns the minimum bounding geometry that completely encloses the given geometry.
geometry  for which convex hull needs to be calculated. Typically either an AGSMultipoint , AGSPolygon , or AGSPolyline . 
+ (nullable NSArray<AGSGeometry *> *) cutGeometry:  (AGSGeometry *)  geometry  
withCutter:  (AGSPolyline *)  cutter  
Cut the 'geometry' with the 'cutter'. The cutter and geometry's spatial references must match. When cutting an AGSPolyline
, all left cuts will be grouped together in the first AGSGeometry
, right cuts and coincident cuts are grouped in the second AGSGeometry
, and each undefined cut, along with any uncut parts, are output as separate AGSPolylines
. When cutting an AGSPolygon
, all left cuts are grouped in the first AGSGeometry
, all right cuts are in the second AGSGeometry
, and each undefined cut, along with any leftover parts after cutting, are output as a separate AGSGeometry
. If there were no cuts the an empty NSArray
will be returned. If the left or right cut does not exist, the returned AGSGeometry
will be empty for this type of cut. An undefined cut will only be produced if a left cut or right cut was produced, and there was a part left over after cutting or a cut is bounded to the left and right of the cutter. If an error occurs, nil is returned.
geometry  to cut 
cutter  polyline to cut with 
+ (nullable AGSGeometry*) densifyGeometry:  (AGSGeometry *)  geometry  
maxSegmentLength:  (double)  maxSegmentLength  
Densifies the input geometry by plotting points between existing vertices.
geometry  The input geometry 
maxSegmentLength  The maximum distance between points after densification. This distance should be in the same unit as the geometry's spatial reference. 
+ (nullable AGSGeometry*) differenceOfGeometry1:  (AGSGeometry *)  geometry1  
geometry2:  (AGSGeometry *)  geometry2  
Constructs the settheoretic difference between two geometries.
geometry1  The first geometry. 
geometry2  The second geometry. Must be of same type as first geometry. 
+ (double) distanceBetweenGeometry1:  (AGSGeometry *)  geometry1  
geometry2:  (AGSGeometry *)  geometry2  
Measures the simple planar distance between two geometries.
geometry1  The first geometry. 
geometry2  The second geometry. 
+ (nullable AGSPolyline*) extendPolyline:  (AGSPolyline *)  polyline  
withPolyline:  (AGSPolyline *)  extender  
options:  (AGSGeometryExtendOption)  options  
Extends a polyline using a polyline as the extender.
The output polyline will have the first and last segment of each path extended to the extender if the segments can be interpolated to intersect the extender. In the case that the segments can be extended to multiple segments of the extender, the shortest extension is chosen. Only end points for paths that are not shared by the end points of other paths will be extended. If the polyline cannot be extended by the input extender, then nil will be returned.
polyline  The polyline to be extended. 
extender  The polyline to extend to. 
options  The flags for the type of extend operation to perform. 
+ (nullable AGSGeometry*) generalizeGeometry:  (AGSGeometry *)  geometry  
maxDeviation:  (double)  maxDeviation  
removeDegenerateParts:  (BOOL)  removeDegenerateParts  
Generalizes the input geometry by removing vertices based on the DouglasPoiker algorithm.
geometry  The input geometry 
maxDeviation  the maximum distance that the generalized geometry can deviate from the original one, specified in the units of the input geometry's spatial reference 
removeDegenerateParts  If YES, degenerate parts of the generalized geometry that are undesired for drawing will be removed. 
+ (nullable AGSGeometry*) geodesicEllipseWithParameters:  (AGSGeodesicEllipseParameters *)  params 
Constructs a geodesic ellipse that is centered on a specified point and defined by it's 2 axes and the direction of it's longest axis. The ellipse is provided as a AGSPolygon, AGSPolyline or AGSMultipoint geometry.
params  Specifies the parameters for constructing the ellipse. 
+ (nullable AGSGeometry*) geodesicSectorWithParameters:  (AGSGeodesicSectorParameters *)  params 
Constructs a geodesic sector defined by a geodesic arc and 2 radii. The arc is a portion of an ellipse that is centered on a specified point and is defined by it's 2 axes and the length of it's longest axis. The first radius angle is defined by the startDirection angle and the second radius angle is the sum of the startDirection and the sectorAngle. The sector is constructed as a AGSPolygon, AGSPolyline or AGSMultipoint geometry.
params  Specifies the parameters for constructing the sector. 
+ (double) geodeticAreaOfGeometry:  (AGSGeometry *)  geometry  
areaUnit:  (AGSAreaUnit *)  areaUnit  
curveType:  (AGSGeodeticCurveType)  curveType  
Gets the geodetic area for the AGSGeometry passed in. Will return NAN if the calculation results in a linear to angular conversion (for instance, Decimal Degrees to Meters)
geometry  The geometry to calculate the area for. 
areaUnit  The unit at which the area is calculated. 
curveType  The type of geodetic curve 
+ (nullable NSArray<AGSGeometry*>*) geodeticBufferGeometries:  (NSArray< AGSGeometry * > *)  geometries  
distances:  (NSArray< NSNumber * > *)  distances  
distanceUnit:  (AGSLinearUnit *)  distanceUnit  
maxDeviation:  (double)  maxDeviation  
curveType:  (AGSGeodeticCurveType)  curveType  
unionResults:  (BOOL)  unionResults  
Calculates the geodesic buffer of the geometries in a given array.
geometries  An NSArray of geometries. 
distances  The distance to buffer each geometry, expressed as NSArray of NSNumbers (doubles). If the size of the distances array is less than the number of geometries, the last distance value is used for the rest of geometries. 
distanceUnit  The unit of measure for the distance. 
maxDeviation  The maximum deviation between points. 
curveType  The curve type to calculate. 
unionResults  Return a single geometry that buffers all the geometries (YES), or one buffer for each in the given collection (NO). 
unionResult
is YES, there will be only a single polygon in the resulting collection. If geometries is empty, returns an empty array. Returns nil on error. The geometries must have consistent, nonnil spatial references. + (nullable AGSPolygon*) geodeticBufferGeometry:  (AGSGeometry *)  geometry  
distance:  (double)  distance  
distanceUnit:  (AGSLinearUnit *)  distanceUnit  
maxDeviation:  (double)  maxDeviation  
curveType:  (AGSGeodeticCurveType)  curveType  
Creates a buffer polygon at the specified distance around the given geometry.
geometry  The input geometry 
distance  The distance by which to buffer the geometry 
distanceUnit  in which the distance is specified 
maxDeviation  the maximum distance that the generalized buffer geometry can deviate from the original one, specified in the units of distanceUnit . Can be NaN for default behavior, or must be a value between 0.001 and 0.5*abs(distance ) 
curveType  The type of geodetic curve. AGSGeodeticCurveTypeShapePreserving is a good option for most cases. 
+ (nullable AGSGeometry*) geodeticDensifyGeometry:  (AGSGeometry *)  geometry  
maxSegmentLength:  (double)  maxSegmentLength  
lengthUnit:  (AGSLinearUnit *)  lengthUnit  
curveType:  (AGSGeodeticCurveType)  curveType  
Densifies the input geometry by plotting points between existing vertices.
geometry  The input geometry 
maxSegmentLength  The maximum distance between points after densification. 
lengthUnit  The unit that the max segment length parameter is in. 
curveType  The type of geodetic curve 
+ (nullable AGSGeodeticDistanceResult*) geodeticDistanceBetweenPoint1:  (AGSPoint *)  point1  
point2:  (AGSPoint *)  point2  
distanceUnit:  (AGSLinearUnit *)  distanceUnit  
azimuthUnit:  (AGSAngularUnit *)  azimuthUnit  
curveType:  (AGSGeodeticCurveType)  curveType  
Returns the geodetic distance between 2 given points and calculates the azimuth at both points for the geodetic curves that connects the points.
point1  The first point 
point2  The second point 
distanceUnit  The linear units of the distance returned in the AGSGeodeticDistanceResult object 
azimuthUnit  The angular unit of the azimuth returned in the AGSGeodeticDistanceResult object 
curveType  The type of geodetic curve 
+ (double) geodeticLengthOfGeometry:  (AGSGeometry *)  geometry  
lengthUnit:  (AGSLinearUnit *)  lengthUnit  
curveType:  (AGSGeodeticCurveType)  curveType  
Gets the geodetic length for the AGSGeometry passed in. The length is calculated using only the vertices of the polygon and define the lines between the points as geodesic segments independent of the actual shape of the polygon. A geodesic segment is the shortest path between two points on an ellipsoid. Thus, if you have a line that spans the width of the world, with only two vertices, each on the edges of the map, the geodesic length would be zero (shortest distance between the two vertices).
Will return NAN if the calculation results in a linear to angular conversion (for instance, Decimal Degrees to Meters)
geometry  The geometry to calculate the geodetic length for. 
lengthUnit  The unit at which the length is calculated. 
curveType  The type of geodetic curve 
+ lengthOfGeometry:
+ (nullable NSArray<AGSPoint*>*) geodeticMovePoints:  (NSArray< AGSPoint * > *)  points  
distance:  (double)  distance  
distanceUnit:  (AGSLinearUnit *)  distanceUnit  
azimuth:  (double)  azimuth  
azimuthUnit:  (AGSAngularUnit *)  azimuthUnit  
curveType:  (AGSGeodeticCurveType)  curveType  
Gets an array of AGSPoint objects that have been moved by geodetic calculation. Each point in the array is moved by the given distance and azimuth.
points  An array of points to be moved. 
distance  The distance by which the points are moved. 
distanceUnit  The linear units of the distance. The default is AGSSRUnitMeter. 
azimuth  The azimuth for the points to be moved along. 
azimuthUnit  The angular unit of the azimuth. 
curveType  The type of geodetic curve 
+ (BOOL) geometry:  (AGSGeometry *)  geometry1  
containsGeometry:  (AGSGeometry *)  geometry2  
Returns YES if geometry1 contains geometry2.
+ (BOOL) geometry:  (AGSGeometry *)  geometry1  
crossesGeometry:  (AGSGeometry *)  geometry2  
Returns YES if geometry1 crosses geometry2.
+ (BOOL) geometry:  (AGSGeometry *)  geometry1  
disjointToGeometry:  (AGSGeometry *)  geometry2  
Returns YES if geometry1 is disjoint to geometry2.
+ (BOOL) geometry:  (AGSGeometry *)  geometry1  
equalsGeometry:  (AGSGeometry *)  geometry2  
Returns YES if geometry1 is equal to geometry2.
+ (BOOL) geometry:  (AGSGeometry *)  geometry1  
intersectsGeometry:  (AGSGeometry *)  geometry2  
Returns YES if geometry1 intersects geometry2.
+ (BOOL) geometry:  (AGSGeometry *)  geometry1  
overlapsGeometry:  (AGSGeometry *)  geometry2  
Returns YES if geometry1 overlaps geometry2. It compares two geometries of the same dimension and returns TRUE if their intersection results in a geometry different from both but of the same dimension.
+ (BOOL) geometry:  (AGSGeometry *)  geometry1  
relatesToGeometry:  (AGSGeometry *)  geometry2  
byRelation:  (NSString *)  relation  
Determines if geometry1
is related to geometry2
by the relation
specified. Example: To test if a polygon 'P' contains a point 'pt' you would pass the following: [AGSGeometryEngine geometry:P relatesToGeometry:pt byRelation:"T*****FF*"]
. This checks:
geometry1  The input geometry to be compared. 
geometry2  The input geometry in which we are comparing geometry1 against. 
relation  The DE9IM string to be evaluated. Strings such as "T*****FF*" are accepted. 
True
or False
. + (BOOL) geometry:  (AGSGeometry *)  geometry1  
touchesGeometry:  (AGSGeometry *)  geometry2  
Returns YES if geometry1 touches geometry2.
+ (BOOL) geometry:  (AGSGeometry *)  geometry1  
withinGeometry:  (AGSGeometry *)  geometry2  
Returns YES if geometry1 is completely within geometry2.
+ (AGSGeometry*) geometryByRemovingMFromGeometry:  (AGSGeometry *)  geometry 
Return a copy of the given geometry with its M values removed.
geometry  A geometry. 
+ (AGSGeometry*) geometryByRemovingZAndMFromGeometry:  (AGSGeometry *)  geometry 
Return a copy of the given geometry with its Z ordinate and M values removed.
geometry  A geometry. 
+ (AGSGeometry*) geometryByRemovingZFromGeometry:  (AGSGeometry *)  geometry 
Return a copy of the given geometry with its Z ordinate removed.
geometry  A geometry. 
+ (AGSGeometry*) geometryBySettingM:  (double)  m  
inGeometry:  (AGSGeometry *)  geometry  
Return a copy of a geometry with the supplied M value.
If the given geometry already has M values, they will be replaced within the resulting geometry by the supplied M value. The resulting geometry will have hasM true.
m  The M value. 
geometry  A geometry. 
+ (AGSGeometry*) geometryBySettingZ:  (double)  z  
inGeometry:  (AGSGeometry *)  geometry  
Return a copy of a geometry with the supplied Z ordinate.
If the given geometry already has Z ordinates, they will be replaced within the resulting geometry by the supplied Z value. The resulting geometry will have hasZ true.
z  The Z ordinate. 
geometry  A geometry. 
+ (AGSGeometry*) geometryBySettingZ:  (double)  z  
M:  (double)  m  
inGeometry:  (AGSGeometry *)  geometry  
Return a copy of a geometry with the supplied Z and M values.
If the given geometry already has Z ordinates or M values, they will be replaced in the resulting geometry by the supplied Z and M values. The resulting geometry will have both hasZ and hasM true.
z  The Z ordinate. 
m  The M value. 
geometry  A geometry. 
+ (BOOL) geometryIsSimple:  (AGSGeometry *)  geometry 
Returns YES if geometry is topologically simple.
+ (nullable AGSGeometry*) intersectionOfGeometry1:  (AGSGeometry *)  geometry1  
geometry2:  (AGSGeometry *)  geometry2  
Constructs the settheoretic intersection between two geometries.
geometry1  The first geometry. 
geometry2  The second geometry. Must be of same type as first geometry. 
+ (nullable AGSPoint*) labelPointForPolygon:  (AGSPolygon *)  polygon 
Calculates an interior point for a specified polygon. This interior point can be used by clients to place a label for the polygon.
polygon  The polygon to get label points for. 
+ (double) lengthOfGeometry:  (AGSGeometry *)  geometry 
Gets the length for a specified AGSGeometry
. This is a planar measurement using 2D Cartesian mathematics to compute the length.
The geometry must be topologically correct to get its accurate legth. Geometries returned by ArcGIS Server services are always correct. If you construct geometries programmatically or using the sketch layer, or if you modify geometries returned by ArcGIS Server, you should simplify them using simplifyGeometry:
geometry  The geometry to calculate the length for. 
+ (nullable AGSProximityResult*) nearestCoordinateInGeometry:  (AGSGeometry *)  geometry  
toPoint:  (AGSPoint *)  point  
Finds the nearest coordinate in a specified geometry to a specified point.
geometry  The geometry in which the nearest coordinate to a specified point is to be found. 
point  The point which to find the nearest coordinate to. 
+ (nullable AGSProximityResult*) nearestVertexInGeometry:  (AGSGeometry *)  geometry  
toPoint:  (AGSPoint *)  point  
Finds the nearest vertex in a specified geometry to a specified point.
geometry  The geometry in which the nearest vertex to a specified point is to be found. 
point  The point which to find the nearest vertex to. 
+ (nullable AGSGeometry*) normalizeCentralMeridianOfGeometry:  (AGSGeometry *)  geometry 
Folds the geometry into a range of 360 degrees. This may be necessary when wrap around is enabled on the map.
geometry  The geometry that you want folded. 
+ (nullable AGSGeometry*) offsetGeometry:  (AGSGeometry *)  geometry  
distance:  (double)  distance  
offsetType:  (AGSGeometryOffsetType)  offsetType  
bevelRatio:  (double)  bevelRatio  
flattenError:  (double)  flattenError  
Creates offset version of the input geometries.
The offset operation creates a geometry that is a constant distance from an input polyline or polygon. It is similar to buffering, but produces a one sided result. If offsetDistance > 0, then the offset geometry is constructed to the right of the oriented input geometry, otherwise it is constructed to the left. For a simple polygon, the orientation of outer rings is clockwise and for inner rings it is counter clockwise. So the “right side” of a simple polygon is always its inside. The bevelRatio is multiplied by the offset distance and the result determines how far a mitered offset intersection can be from the input curve before it is beveled.
geometry  The geometry to calculate offset for. Point and MultiPoint are not supported. 
distance  The offset distance for the Geometries. 
offsetType  The join type of the offset geometry. 
bevelRatio  The ratio used to produce a bevel join instead of a miter join (used only when joins is Miter) 
flattenError  The maximum distance of the resulting segments compared to the true circular arc (used only when joins is Round). If flattenError is 0, tolerance value is used. Also, the algorithm never produces more than around 180 vetices for each round join. 
+ (nullable AGSPoint *) pointAlongPolyline:  (AGSPolyline *)  polyline  
distance:  (double)  distance  
Returns the point at the given distance along the line. If distance is less than or equal to zero, the point returned is coincident with the start of the line. If distance is greater than or equal to the line's length, the point returned is coincident with the end of the line. If the line has multiple parts, and the distance falls exactly on a boundary between two parts, the returned point will be coincident with either the end of one part or the start of the next–which is undetermined.
polyline  A line. 
distance  The distance along the line of the point to return, in the line's units. 
+ (nullable AGSGeometry*) projectGeometry:  (AGSGeometry *)  geometry  
toSpatialReference:  (AGSSpatialReference *)  spatialReference  
Projects the given geometry into a new spatial reference.
geometry  The geometry to be projected. 
spatialReference  The spatial reference to which geometry need to be projected. 
+ (nullable AGSMultipart*) reshapeGeometry:  (AGSMultipart *)  geometry  
withPolyline:  (AGSPolyline *)  reshaper  
Reshape polygons or polylines with a single path polyline.
Performs the reshape operation on a polygon or polyline using a single path polyline as the reshaper. The output geometry takes the shape of the Multi_path where it first intersects the reshaper to the last intersection. The first and last intersection points of the reshaper are chosen closest to the end points of the reshaper in the case that multiple intersections are found. For polygons, only individual paths can be reshaped. However, polylines can be reshaped across paths. If the geometry cannot be reshaped by the input reshaper, then nil will be returned.
geometry  The polygon or polyline to be reshaped. 
reshaper  The single path polyline reshaper 
+ (nullable AGSGeometry*) simplifyGeometry:  (AGSGeometry *)  geometry 
Simplifies the given geometry to make it topologically consistent according to their geometry type. For instance, it rectifies polygons that may be selfintersecting, or contain incorrect ring orientations.
geometry  The geometry to be simplified. 
+ (nullable AGSGeometry*) symmetricDifferenceOfGeometry1:  (AGSGeometry *)  geometry1  
geometry2:  (AGSGeometry *)  geometry2  
Constructs the settheoretic symmetric difference between two geometries.
geometry1  The first geometry. 
geometry2  The second geometry of dimension equal to or greater than the elements of the first geometry. 
+ (nullable AGSGeometry*) unionGeometries:  (NSArray< AGSGeometry * > *)  geometries 
Calculates the union of an array of geometries
There must be at least one geometry in the given array. The geometries must have consistent spatial references. If the array contains geometries of differing dimensionality, returns the union of the subset of geometries with the highest dimensionality. E.g. given a collection of polygons, polylines and points, returns the union of the polygons.
geometries  An NSArray of geometries. 
+ (nullable AGSGeometry*) unionOfGeometry1:  (AGSGeometry *)  geometry1  
geometry2:  (AGSGeometry *)  geometry2  
The union operation constructs the settheoretic union of the two provided geometries.
geometry1  The first geometry. 
geometry2  The second geometry. Must be of same type as first geometry. 