ArcGIS Runtime SDK for iOS: AGSGeometryEngine Class Reference
ArcGIS Runtime SDK for iOS  100.15
AGSGeometryEngine Class Reference

Description

A class providing methods for operating on AGSGeometry objects.

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 -

  • Create new geometries from others with methods that buffer, clip and join (union) geometries
  • Test spatial relationships between geometries such as intersect and contains
  • Find the points of nearest distance between geometries
  • Reproject geometries
  • Calculate area and length
  • Convert geometries to and from their JSON representation
  • Perform planar and geodesic/geodetic operations

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.

Since
100
Inheritance diagram for AGSGeometryEngine:
AGSObject

Class Methods

(double) + areaOfGeometry:
 
(nullable NSArray< AGSPolygon * > *) + autoCompleteForExistingBoundaries:newBoundaries:
 
(nullable AGSGeometry *) + boundaryOfGeometry:
 
(nullable NSArray< AGSGeometry * > *) + bufferGeometries:distances:unionResults:
 
(nullable AGSPolygon *) + bufferGeometry:byDistance:
 
(nullable AGSGeometry *) + clipGeometry:withEnvelope:
 
(nullable AGSEnvelope *) + combineExtentsOfGeometries:
 
(nullable AGSEnvelope *) + combineExtentsOfGeometry:andGeometry:
 
(nullable NSArray< AGSGeometry * > *) + convexHullForGeometries:mergeInputs:
 
(nullable AGSGeometry *) + convexHullForGeometry:
 
(nullable NSArray< AGSGeometry * > *) + cutGeometry:withCutter:
 
(nullable AGSGeometry *) + densifyGeometry:maxSegmentLength:
 
(nullable AGSGeometry *) + differenceOfGeometry1:geometry2:
 
(double) + distanceBetweenGeometry1:geometry2:
 
(nullable AGSPolyline *) + extendPolyline:withPolyline:options:
 
(double) + fractionAlongLine:toPoint:tolerance:
 
(nullable AGSGeometry *) + generalizeGeometry:maxDeviation:removeDegenerateParts:
 
(nullable AGSGeometry *) + geodesicEllipseWithParameters:
 
(nullable AGSGeometry *) + geodesicSectorWithParameters:
 
(double) + geodeticAreaOfGeometry:areaUnit:curveType:
 
(nullable NSArray< AGSGeometry * > *) + geodeticBufferGeometries:distances:distanceUnit:maxDeviation:curveType:unionResults:
 
(nullable AGSPolygon *) + geodeticBufferGeometry:distance:distanceUnit:maxDeviation:curveType:
 
(nullable AGSGeometry *) + geodeticDensifyGeometry:maxSegmentLength:lengthUnit:curveType:
 
(nullable AGSGeodeticDistanceResult *) + geodeticDistanceBetweenPoint1:point2:distanceUnit:azimuthUnit:curveType:
 
(double) + geodeticLengthOfGeometry:lengthUnit:curveType:
 
(nullable NSArray< AGSPoint * > *) + geodeticMovePoints:distance:distanceUnit:azimuth:azimuthUnit:curveType:
 
(nullable AGSProximityResult *) + geodeticNearestCoordinateInGeometry:point:maxDeviation:deviationUnit:
 
(BOOL) + geometry:containsGeometry:
 
(BOOL) + geometry:crossesGeometry:
 
(BOOL) + geometry:disjointToGeometry:
 
(BOOL) + geometry:equalsGeometry:
 
(BOOL) + geometry:intersectsGeometry:
 
(BOOL) + geometry:overlapsGeometry:
 
(BOOL) + geometry:relatesToGeometry:byRelation:
 
(BOOL) + geometry:touchesGeometry:
 
(BOOL) + geometry:withinGeometry:
 
(AGSGeometry *) + geometryByRemovingMFromGeometry:
 
(AGSGeometry *) + geometryByRemovingZAndMFromGeometry:
 
(AGSGeometry *) + geometryByRemovingZFromGeometry:
 
(AGSGeometry *) + geometryBySettingM:inGeometry:
 
(AGSGeometry *) + geometryBySettingZ:inGeometry:
 
(AGSGeometry *) + geometryBySettingZ:M:inGeometry:
 
(BOOL) + geometryIsSimple:
 
(nullable AGSGeometry *) + intersectionOfGeometry1:geometry2:
 
(nullable NSArray *) + intersectionsOfGeometry1:geometry2:
 
(nullable AGSPoint *) + labelPointForPolygon:
 
(double) + lengthOfGeometry:
 
(nullable AGSProximityResult *) + nearestCoordinateInGeometry:toPoint:
 
(nullable AGSProximityResult *) + nearestVertexInGeometry:toPoint:
 
(nullable AGSGeometry *) + normalizeCentralMeridianOfGeometry:
 
(nullable AGSGeometry *) + offsetGeometry:distance:offsetType:bevelRatio:flattenError:
 
(nullable AGSPoint *) + pointAlongPolyline:distance:
 
(nullable AGSGeometry *) + projectGeometry:toSpatialReference:
 
(nullable AGSGeometry *) + projectGeometry:toSpatialReference:datumTransformation:
 
(nullable AGSMultipart *) + reshapeGeometry:withPolyline:
 
(nullable AGSGeometry *) + simplifyGeometry:
 
(nullable AGSGeometry *) + symmetricDifferenceOfGeometry1:geometry2:
 
(nullable AGSGeometry *) + unionGeometries:
 
(nullable AGSGeometry *) + unionOfGeometry1:geometry2:
 

Method Documentation

◆ areaOfGeometry:

+ (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 planar measurements of distance and area can be extremely inaccurate if using an unsuitable spatial reference. Ensure that you understand the potential for error with the geometry's spatial reference. If you need to calculate more accurate results consider using a different spatial reference, or using the geodetic equivalent, AGSGeometryEngine::areaGeodeticWithGeometry:unit:curveType:.

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:

Supports true curves.

Parameters
geometryThe geometry to calculate the area for.
Returns
The computed area in the same units as the geometry's spatial reference unit.
Since
100
See also
AGSGeometryEngine::areaGeodeticWithGeometry:unit:curveType:
https://developers.arcgis.com/documentation/core-concepts/spatial-references/ for more information about spatial references.

◆ autoCompleteForExistingBoundaries:newBoundaries:

+ (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.

Parameters
existingBoundariesThe polygons.
newBoundariesThe polylines.
Returns
The new polygons that were created. If either existingBoundaries or newBoundaries is empty, returns an empty array. Returns nil on error.
Since
100.1

◆ boundaryOfGeometry:

+ (nullable AGSGeometry*) boundaryOfGeometry: (AGSGeometry *)  geometry

Calculates the boundary of the given geometry.

Supports true curves.

Parameters
geometryA geometry object.
Returns
The boundary of the given geometry.
Since
100

◆ bufferGeometries:distances:unionResults:

+ (nullable NSArray<AGSGeometry*>*) bufferGeometries: (NSArray< AGSGeometry * > *)  geometries
distances: (NSArray< NSNumber * > *)  distances
unionResults: (BOOL)  unionResults 

Creates and returns a buffer relative to the given geometries.

The geometries must have the same spatial reference. Planar measurements of distance and area can be extremely inaccurate if using an unsuitable spatial reference. Ensure that you understand the potential for error with the geometry's spatial reference. If you need to calculate more accurate results consider using a different spatial reference, or using the geodetic equivalent, geodeticBufferGeometries:distances:distanceUnit:maxDeviation:curveType:unionResults:.

Supports true curves as input, producing a densified curve as output where applicable

Parameters
geometriesA collection of geometries.
distancesThe distance (in the unit of the geometry's spatial reference) to buffer each geometry, expressed as an array of NSNumber (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.
unionResultsReturns a single geometry that buffers all the geometries (YES), or one buffer for each in the given collection (NO).
Returns
A collection of polygons representing buffers at the defined distance(s) relative to the input geometries. If unionResults is YES, there will be only a single polygon in the resulting collection. Returns nil on error
Since
100.1
See also
https://developers.arcgis.com/documentation/spatial-references/ for more information about spatial references.

◆ bufferGeometry:byDistance:

+ (nullable AGSPolygon*) bufferGeometry: (AGSGeometry *)  geometry
byDistance: (double)  distance 

Returns a geometry object that represents a buffer relative to the given geometry.

Planar measurements of distance and area can be extremely inaccurate if using an unsuitable spatial reference. Ensure that you understand the potential for error with the geometry's spatial reference. If you need to calculate more accurate results consider using a different spatial reference, or using the geodetic equivalent, geodeticBufferGeometry:distance:distanceUnit:maxDeviation:curveType:.

Supports true curves as input, producing a densified curve as output where applicable.

Parameters
geometrySpecifies the input geometry.
distanceThe distance (in the unit of the geometry's spatial reference) by which to buffer the geometry.
Returns
A polygon object that represents a buffer at the desired distance relative to the given geometry. Returns nil on error.
Since
100
See also
AGSUnit::convert:fromUnit: and AGSUnit::convert:toUnit: to convert values between different units
https://developers.arcgis.com/documentation/spatial-references/ for more information about spatial references.

◆ clipGeometry:withEnvelope:

+ (nullable AGSGeometry*) clipGeometry: (AGSGeometry *)  geometry
withEnvelope: (AGSEnvelope *)  envelope 

Constructs the polygon created by clipping geometry by envelope.

Supports true curves.

Parameters
geometryThe geometry to be clipped by the given envelope.
envelopeThe envelope in which to use in order to clip geometry.
Returns
A geometry that represents the area clipped by envelope.
Since
100

◆ combineExtentsOfGeometries:

+ (nullable AGSEnvelope*) combineExtentsOfGeometries: (NSArray< AGSGeometry * > *)  geometries

Returns the combined envelope of geometries in the given array.

The geometries must have consistent spatial references.

Supports true curves.

Parameters
geometriesAn NSArray of geometries.
Returns
The maximum extents of the geometries in the collection, or nil on error.
Since
100.1

◆ combineExtentsOfGeometry:andGeometry:

+ (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.

Supports true curves.

Parameters
geometry1A geometry object.
geometry2Another geometry object.
Returns
The maximum extents of the two given geometries, or nil on error.
Since
100.1

◆ convexHullForGeometries:mergeInputs:

+ (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.

Parameters
geometriesAn NSArray of geometries.
mergeInputsReturn a single geometry that encloses all the geometries (YES), or one enclosing geometry for each in the collection (NO).
Returns
If mergeInputs is YES, returns a single convex hull that encloses all the geometries in the collection as a single geometry in an array. If mergeInputs is NO, returns the minimum bounding geometry that completely encloses each of the geometries in the given collection as an array of geometries. If geometries is empty, returns an empty array. Returns nil on error.
Since
100.1

◆ convexHullForGeometry:

+ (nullable AGSGeometry*) convexHullForGeometry: (AGSGeometry *)  geometry

Returns the minimum bounding geometry that completely encloses the given geometry.

Parameters
geometryfor which convex hull needs to be calculated. Typically either an AGSMultipoint, AGSPolygon, or AGSPolyline.
Returns
The minimum bounding geometry.
Since
100

◆ cutGeometry:withCutter:

+ (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 left-over parts after cutting, are output as a separate AGSGeometry. If there were no cuts then 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.

Parameters
geometryto cut.
cutterpolyline to cut with.
Since
100

◆ densifyGeometry:maxSegmentLength:

+ (nullable AGSGeometry*) densifyGeometry: (AGSGeometry *)  geometry
maxSegmentLength: (double)  maxSegmentLength 

Densifies the input geometry by inserting additional vertices along the geometry at an interval defined by maxSegmentLength. Additional vertices are not inserted on segments of the input AGSPolyline or AGSPolygon that are shorter than maxSegmentLength.

Supports true curves as input, producing a densified curve as output where applicable.

Parameters
geometryAn AGSPolyline or AGSPolygon geometry.
maxSegmentLengthThe maximum distance between vertices when the input geometry is densified. The linear unit is assumed to be that of the input geometry's spatial reference (decimal degrees for a geometry with a geographic spatial reference, meters for geometry with a Mercator spatial reference, and so on). Use AGSSpatialReference::unit to determine the unit used by a specific spatial reference. https://developers.arcgis.com/rest/services-reference/projected-coordinate-systems.htm.
Returns
The densified geometry.
Since
100

◆ differenceOfGeometry1:geometry2:

+ (nullable AGSGeometry*) differenceOfGeometry1: (AGSGeometry *)  geometry1
geometry2: (AGSGeometry *)  geometry2 

Constructs the set-theoretic difference between two geometries.

Supports true curves.

Parameters
geometry1The first geometry.
geometry2The second geometry. Must be of same type as first geometry.
Returns
A geometry that represents the difference of the two input geometries.
Since
100

◆ distanceBetweenGeometry1:geometry2:

+ (double) distanceBetweenGeometry1: (AGSGeometry *)  geometry1
geometry2: (AGSGeometry *)  geometry2 

Measures the simple planar distance between two geometries. Planar measurements of distance and area can be extremely inaccurate if using an unsuitable spatial reference. Ensure that you understand the potential for error with the geometry's spatial reference. If you need to calculate more accurate results consider using a different spatial reference, or using the geodetic equivalent, geodeticDistanceBetweenPoint1:point2:distanceUnit:azimuthUnit:curveType:.

Parameters
geometry1The first geometry.
geometry2The second geometry.
Returns
The distance between the two input geometries in the same unit as the spatial reference of the input geometries.
Since
100
See also
https://developers.arcgis.com/documentation/spatial-references/ for more information about spatial references.

◆ extendPolyline:withPolyline:options:

+ (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.

Parameters
polylineThe polyline to be extended.
extenderThe polyline to extend to.
optionsThe flags for the type of extend operation to perform.
Returns
The extended polyline. Returns nil on error.
Since
100.1

◆ fractionAlongLine:toPoint:tolerance:

+ (double) fractionAlongLine: (AGSPolyline *)  line
toPoint: (AGSPoint *)  point
tolerance: (double)  tolerance 

Finds the location on the line nearest the input 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.

Supports true curves.

Parameters
lineThe line to locate the point's distance along its length.
pointThe point to locate.
toleranceThe maximum distance that a point is allowed to be from the line, in the units of the AGSSpatialReference. If the tolerance is -1, the fraction of the closest location on the line is always returned as long as the point lies between the two ends of the polyline. If the distance from the point to the closest location on the line is greater than the tolerance, or the tolerance is -1 and the point does not lie between the two ends of the polyline, NAN is returned.
Returns
The length along the line nearest the input point, expressed as the fraction of the line's length between 0.0 and 1.0, or NAN if the point is outside the tolerance.
Since
100.6

◆ generalizeGeometry:maxDeviation:removeDegenerateParts:

+ (nullable AGSGeometry*) generalizeGeometry: (AGSGeometry *)  geometry
maxDeviation: (double)  maxDeviation
removeDegenerateParts: (BOOL)  removeDegenerateParts 

Generalizes the input geometry by removing vertices based on the Douglas-Poiker algorithm.

Supports true curves as input, producing a densified curve as output where applicable.

Parameters
geometryThe input geometry.
maxDeviationThe maximum distance that the generalized geometry can deviate from the original one, specified in the units of the input geometry's spatial reference.
removeDegeneratePartsIf YES, degenerate parts of the generalized geometry that are undesired for drawing will be removed.
Since
100

◆ geodesicEllipseWithParameters:

+ (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.

Parameters
paramsSpecifies the parameters for constructing the ellipse.
Returns
The ellipse is returned in the format specified by the geometryType parameter. The ellipse is generalized according to the vertexCount.
Since
100

◆ geodesicSectorWithParameters:

+ (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.

Parameters
paramsSpecifies the parameters for constructing the sector.
Returns
The sector is returned in the format specified by the geometryType and is generalized according to the arcVertexCount and the radiusVertexCount parameters.
Since
100

◆ geodeticAreaOfGeometry:areaUnit:curveType:

+ (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)

Supports true curves, calculating the result by densifying curves.

Parameters
geometryThe geometry to calculate the area for.
areaUnitThe unit at which the area is calculated.
curveTypeThe type of geodetic curve.
Returns
The calculated geodetic area in the specified unit.
Since
100

◆ geodeticBufferGeometries:distances:distanceUnit:maxDeviation:curveType:unionResults:

+ (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.

Geodesic buffers account for the actual shape of the Earth. Distances are calculated between points on a curved surface (the geoid) as opposed to points on a flat surface (the Cartesian plane).

Negative distance can be used to create buffers inside polygons. Using a negative buffer distance will shrink polygons' boundaries by the distance specified. Note that if the negative buffer distance is large enough, polygons may collapse to empty geometries.

Parameters
geometriesAn NSArray of geometries.
distancesThe distance to buffer each geometry, expressed as an array of NSNumber (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.
distanceUnitThe unit of measure for the distance.
maxDeviationThe maximum deviation between points.
curveTypeThe curve type to calculate.
unionResultsReturn a single geometry that buffers all the geometries (YES), or one buffer for each in the given collection (NO).
Returns
A collection of polygon geometries that represent a geodesic buffer at the desired distance(s) relative to the input geometries. If unionResults 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, non-nil spatial references.
Since
100.1

◆ geodeticBufferGeometry:distance:distanceUnit:maxDeviation:curveType:

+ (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.

Geodesic buffers account for the actual shape of the Earth. Distances are calculated between points on a curved surface (the geoid) as opposed to points on a flat surface (the Cartesian plane).

Negative distance can be used to create buffers inside polygons. Using a negative buffer distance shrinks the polygons' boundaries by the distance specified. Note that if the negative buffer distance is large enough, polygons may collapse to empty geometries.

Parameters
geometryThe input geometry.
distanceThe distance by which to buffer the geometry.
distanceUnitin which the distance is specified.
maxDeviationthe 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).
curveTypeThe type of geodetic curve. AGSGeodeticCurveTypeShapePreserving is a good option for most cases.
Returns
The geodetically buffered geometry.
Since
100

◆ geodeticDensifyGeometry:maxSegmentLength:lengthUnit:curveType:

+ (nullable AGSGeometry*) geodeticDensifyGeometry: (AGSGeometry *)  geometry
maxSegmentLength: (double)  maxSegmentLength
lengthUnit: (AGSLinearUnit *)  lengthUnit
curveType: (AGSGeodeticCurveType curveType 

Densifies the input geometry by creating additional vertices along the geometry, using a geodesic curve.

Parameters
geometryThe input geometry.
maxSegmentLengthThe maximum distance between vertices when the input geometry is densified.
lengthUnitThe unit that the max segment length parameter is in.
curveTypeThe type of geodetic curve.
Returns
The geodetically densified geometry.
Since
100

◆ geodeticDistanceBetweenPoint1:point2:distanceUnit:azimuthUnit:curveType:

+ (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.

Parameters
point1The first point.
point2The second point.
distanceUnitThe linear units of the distance returned in the AGSGeodeticDistanceResult object.
azimuthUnitThe angular unit of the azimuth returned in the AGSGeodeticDistanceResult object.
curveTypeThe type of geodetic curve.
Returns
The AGSGeodeticDistanceResult object containing the shortest distance between the 2 points along the geodetic curve, and the azimuth at both those points.
Since
100

◆ geodeticLengthOfGeometry:lengthUnit:curveType:

+ (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).

Supports true curves, calculating the result by densifying curves.

Parameters
geometryThe geometry to calculate the geodetic length for.
lengthUnitThe unit at which the length is calculated.
curveTypeThe type of geodetic curve.
Returns
The calculated geodetic length in the specified unit.
Since
100
See also
+ lengthOfGeometry:

◆ geodeticMovePoints:distance:distanceUnit:azimuth:azimuthUnit:curveType:

+ (nullable NSArray<AGSPoint*>*) geodeticMovePoints: (NSArray< AGSPoint * > *)  points
distance: (double)  distance
distanceUnit: (AGSLinearUnit *)  distanceUnit
azimuth: (double)  azimuth
azimuthUnit: (AGSAngularUnit *)  azimuthUnit
curveType: (AGSGeodeticCurveType curveType 

Moves each point in the point collection by a geodesic distance.

There must be the same spatial reference on each point in the input array of points. The returned array is in the same order as the input, but with new points at their destination locations. Specifying a negative distance moves points in the opposite direction from azimuth.

Parameters
pointsAn array of AGSPoint geometries.
distanceThe distance by which the points are moved.
distanceUnitThe linear units of the distance. The default is AGSSRUnitMeter.
azimuthThe azimuth for the points to be moved along.
azimuthUnitThe angular unit of the azimuth.
curveTypeThe type of geodetic curve.
Returns
An array of points moved along a geodetic curve by distance and azimuth.
Since
100

◆ geodeticNearestCoordinateInGeometry:point:maxDeviation:deviationUnit:

+ (nullable AGSProximityResult *) geodeticNearestCoordinateInGeometry: (AGSGeometry *)  geometry
point: (AGSPoint *)  point
maxDeviation: (double)  maxDeviation
deviationUnit: (nullable AGSLinearUnit *)  deviationUnit 

Determines the nearest point in the input geometry to the input point, by using a shape preserving geodesic approximation of the input geometry.

All geometry types are supported for the geometry parameter. Supports true curves.

Parameters
geometryA geometry object on which to calculate the nearest coordinate to the point parameter.
pointThe point from which to calculate the nearest coordinate on the geometry parameter.
maxDeviationThe maximum distance that the geodesic geometry can deviate from the original, in the units of the deviationUnit parameter.
deviationUnitThe unit of measure for the maxDeviation parameter. If nil, the units of maxDeviation are assumed to be meters.
Returns
An AGSProximityResult containing the results of the operation, where the AGSProximityResult::distance is returned in meters. Returns nil if the input geometry is empty. AGSProximityResult::distance is zero if the point lies inside an input polygon, polyline, or envelope.
See also
+ nearestCoordinateInGeometry:toPoint:
Since
100.14

◆ geometry:containsGeometry:

+ (BOOL) geometry: (AGSGeometry *)  geometry1
containsGeometry: (AGSGeometry *)  geometry2 

Returns YES if geometry1 contains geometry2.

Supports true curves.

Since
100

◆ geometry:crossesGeometry:

+ (BOOL) geometry: (AGSGeometry *)  geometry1
crossesGeometry: (AGSGeometry *)  geometry2 

Returns YES if geometry1 crosses geometry2.

Supports true curves.

Since
100

◆ geometry:disjointToGeometry:

+ (BOOL) geometry: (AGSGeometry *)  geometry1
disjointToGeometry: (AGSGeometry *)  geometry2 

Returns YES if geometry1 is disjoint to geometry2.

Supports true curves.

Since
100

◆ geometry:equalsGeometry:

+ (BOOL) geometry: (AGSGeometry *)  geometry1
equalsGeometry: (AGSGeometry *)  geometry2 

Returns YES if geometry1 is equal to geometry2.

Supports true curves.

Since
100

◆ geometry:intersectsGeometry:

+ (BOOL) geometry: (AGSGeometry *)  geometry1
intersectsGeometry: (AGSGeometry *)  geometry2 

Returns YES if geometry1 intersects geometry2.

Supports true curves.

Since
100

◆ geometry:overlapsGeometry:

+ (BOOL) geometry: (AGSGeometry *)  geometry1
overlapsGeometry: (AGSGeometry *)  geometry2 

Returns YES if geometry1 overlaps geometry2. It compares two geometries of the same dimension and returns YES if their intersection results in a geometry different from both but of the same dimension.

Supports true curves.

Since
100

◆ geometry:relatesToGeometry:byRelation:

+ (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:

  1. The interiors of both geometries intersect
  2. The exterior of P does not intersect the interior of pt
  3. The exterior of P does not intersect the boundary of pt

Supports true curves.

Parameters
geometry1The input geometry to be compared.
geometry2The input geometry in which we are comparing geometry1 against.
relationThe DE-9IM string to be evaluated. Strings such as "T*****FF*" are accepted.
Returns
A boolean indicating if the relation is True or False.
Since
100

◆ geometry:touchesGeometry:

+ (BOOL) geometry: (AGSGeometry *)  geometry1
touchesGeometry: (AGSGeometry *)  geometry2 

Returns YES if geometry1 touches geometry2.

Supports true curves.

Since
100

◆ geometry:withinGeometry:

+ (BOOL) geometry: (AGSGeometry *)  geometry1
withinGeometry: (AGSGeometry *)  geometry2 

Returns YES if geometry1 is completely within geometry2.

Supports true curves.

Since
100

◆ geometryByRemovingMFromGeometry:

+ (AGSGeometry*) geometryByRemovingMFromGeometry: (AGSGeometry *)  geometry

Return a copy of the given geometry with its M values removed.

Supports true curves.

Parameters
geometryA geometry.
Returns
A copy of the given geometry with its M values removed, or nil on error.
Since
100.1

◆ geometryByRemovingZAndMFromGeometry:

+ (AGSGeometry*) geometryByRemovingZAndMFromGeometry: (AGSGeometry *)  geometry

Return a copy of the given geometry with its Z coordinate and M values removed.

Supports true curves.

Parameters
geometryA geometry.
Returns
A copy of the given geometry with both its Z and M attributes removed, or nil on error.
Since
100.1

◆ geometryByRemovingZFromGeometry:

+ (AGSGeometry*) geometryByRemovingZFromGeometry: (AGSGeometry *)  geometry

Return a copy of the given geometry with its Z coordinate removed.

Supports true curves.

Parameters
geometryA geometry.
Returns
A copy of the given geometry with its Z coordinate removed, or nil on error.
Since
100.1

◆ geometryBySettingM:inGeometry:

+ (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 AGSGeometry::hasM as YES.

Supports true curves.

Parameters
mThe M value.
geometryA geometry.
Returns
A copy of the given geometry with its M values set to the supplied value, or nil on error.
Since
100.1

◆ geometryBySettingZ:inGeometry:

+ (AGSGeometry*) geometryBySettingZ: (double)  z
inGeometry: (AGSGeometry *)  geometry 

Return a copy of a geometry with the supplied Z coordinate.

If the given geometry already has Z coordinates, they will be replaced within the resulting geometry by the supplied Z value. The resulting geometry will have AGSGeometry::hasZ as YES.

Supports true curves.

Parameters
zThe Z coordinate.
geometryA geometry.
Returns
A copy of the given geometry with its Z coordinates set to the supplied value, or nil on error.
Since
100.1

◆ geometryBySettingZ:M:inGeometry:

+ (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 coordinates or M values, they will be replaced in the resulting geometry by the supplied Z and M values. The resulting geometry will have both AGSGeometry::hasZ and AGSGeometry::hasM as YES.

Supports true curves.

Parameters
zThe Z coordinate.
mThe M value.
geometryA geometry.
Returns
A copy of the given geometry with its Z and M values set to the supplied values, or nil on error.
Since
100.1

◆ geometryIsSimple:

+ (BOOL) geometryIsSimple: (AGSGeometry *)  geometry

Returns YES if geometry is topologically simple.

Supports true curves.

Since
100

◆ intersectionOfGeometry1:geometry2:

+ (nullable AGSGeometry*) intersectionOfGeometry1: (AGSGeometry *)  geometry1
geometry2: (AGSGeometry *)  geometry2 

Constructs the set-theoretic intersection between two geometries.

Supports true curves.

Parameters
geometry1The first geometry.
geometry2The second geometry. Must be of same type as first geometry.
Returns
A geometry that represents the intersection of the two input geometries.
Since
100

◆ intersectionsOfGeometry1:geometry2:

+ (nullable NSArray*) intersectionsOfGeometry1: (AGSGeometry *)  geometry1
geometry2: (AGSGeometry *)  geometry2 

Calculates the intersection of two geometries.

The returned array contains one geometry of each dimension for which there are intersections. For example, if both inputs are polylines, the array will contain at most two geometries: the first a multipoint containing the points at which the lines cross, and the second a polyline containing the lines of overlap. If a crossing point lies within a line of overlap, only the line of overlap is present – the result set is not self-intersecting. If there are no crossing points or there are no lines of overlap, the respective geometry will not be present in the returned array. If the input geometries do not intersect, the resulting array will be empty. The table below shows, for each combination of pairs of input geometry types, the types of geometry that will be contained within the returned array if there are intersections of that type.

Set of potential output geometry types for pairs of input geometry types
Input type Point/Multipoint Polyline Polygon/Envelope
Point/Multipoint Multipoint Multipoint Multipoint
Polyline Multipoint Multipoint, Polyline Multipoint, Polyline
Polygon/Envelope Multipoint Multipoint, Polyline Multipoint, Polyline, Polygon

The geometries in the returned array are sorted by ascending dimensionality, e.g. multipoint (dimension 0) then polyline (dimension 1) then polygon (dimension 2) for the intersection of two geometries with area that have intersections of those types. Returns nil on error.

Supports true curves.

Parameters
geometry1A geometry object.
geometry2Another geometry object.
Returns
An array of geometry objects that represent the intersection of the given geometries.
Since
100.1

◆ labelPointForPolygon:

+ (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.

Supports true curves.

Parameters
polygonThe polygon to get label points for.
Returns
The label point.
Since
100

◆ lengthOfGeometry:

+ (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:

Supports true curves.

Parameters
geometryThe geometry to calculate the length for.
Returns
The calculated length in the same units as the geometry's spatial reference unit.
Since
100
See also
+ geodeticLengthOfGeometry:lengthUnit:curveType:

◆ nearestCoordinateInGeometry:toPoint:

+ (nullable AGSProximityResult*) nearestCoordinateInGeometry: (AGSGeometry *)  geometry
toPoint: (AGSPoint *)  point 

Determines the nearest point in the input geometry to the input point using a simple planar measurement.

Input geometry of type AGSEnvelope is not supported. To find the nearest coordinate on an AGSEnvelope, convert it to an AGSPolygon first.

If the specified geometry is a polyline or polygon, the nearest coordinate is the closest point in a segment that comprises geometry; it may not necessarily be the closest vertex of a segment. If you want to obtain the closest vertex in the polyline or polygon, use the nearestVertexInGeometry:toPoint: method instead.

Planar measurements of distance and area can be extremely inaccurate if using an unsuitable spatial reference. Ensure that you understand the potential for error with the geometry's spatial reference. If you need to calculate more accurate results consider using a different spatial reference, or using the geodetic equivalent, geodeticNearestCoordinateInGeometry:point:maxDeviation:deviationUnit:.

Supports true curves.

Parameters
geometryThe geometry in which the nearest coordinate to a specified point is to be found.
pointThe point which to find the nearest coordinate to.
Returns
An AGSProximityResult containing the results of the operation. This is nil if the input geometry is empty. AGSProximityResult::distance is zero if the point lies inside an input polygon, polyline, or envelope.
Since
100

◆ nearestVertexInGeometry:toPoint:

+ (nullable AGSProximityResult*) nearestVertexInGeometry: (AGSGeometry *)  geometry
toPoint: (AGSPoint *)  point 

Returns an AGSProximityResult that describes the nearest vertex in the input geometry to the input point.

Input geometry of type AGSEnvelope is not supported. To find the nearest vertex on an AGSEnvelope, convert it to an AGSPolygon first.

Input geometries with true curves (where AGSGeometry::hasCurves is YES) are supported, although curve segments do not affect the return value.

Parameters
geometryThe geometry in which the nearest vertex to a specified point is to be found.
pointThe point which to find the nearest vertex to.
Returns
The proximity result.
Since
100

◆ normalizeCentralMeridianOfGeometry:

+ (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.

Supports true curves.

Parameters
geometryThe geometry that you want folded.
Returns
The folded geometry.
Since
100

◆ offsetGeometry:distance:offsetType:bevelRatio:flattenError:

+ (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.

Parameters
geometryThe geometry to calculate offset for. Point and MultiPoint are not supported.
distanceThe offset distance for the Geometries.
offsetTypeThe join type of the offset geometry.
bevelRatioThe ratio used to produce a bevel join instead of a miter join (used only when joins is Miter).
flattenErrorThe 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.
Returns
Returns the result of the offset operation.
Since
100

◆ pointAlongPolyline:distance:

+ (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.

Supports true curves.

Parameters
polylineA line.
distanceThe distance along the line of the point to return, in the line's units.
Returns
The point result, or nil if an error ocurred.
Since
100.2

◆ projectGeometry:toSpatialReference:

+ (nullable AGSGeometry*) projectGeometry: (AGSGeometry *)  geometry
toSpatialReference: (AGSSpatialReference *)  spatialReference 

Projects the given geometry from its current spatial reference system into the given spatial reference system.

A default best-choice AGSDatumTransformation is applied to the project operation. To control the specific transformation used, use the projectGeometry:toSpatialReference:datumTransformation: overload.

If the geometry parameter has z-values then those z-values will also be transformed, providing the AGSSpatialReference of that geometry, and the spatialReference parameter, both have a vertical coordinate system set.

Supports true curves. Projecting curves located at poles and coordinate system horizons using ArcGIS Runtime may give results that differ slightly from other ArcGIS software because ArcGIS Runtime uses a different geometry projection function.

Parameters
geometryThe geometry to be projected.
spatialReferenceThe spatial reference to which geometry need to be projected.
Returns
The geometry projected into the given spatial reference. If the input geometry has a nil spatial reference, no projection occurs; instead, an identical geometry with the given spatial reference is returned.
Since
100

◆ projectGeometry:toSpatialReference:datumTransformation:

+ (nullable AGSGeometry*) projectGeometry: (AGSGeometry *)  geometry
toSpatialReference: (AGSSpatialReference *)  toSpatialReference
datumTransformation: (nullable AGSDatumTransformation *)  datumTransformation 

Projects the given geometry from its current spatial reference system into the given output spatial reference system, applying the datum transformation provided.

Use this to project a geometry if the difference between the input geometry's spatial reference and the toSpatialReference involves a change of datum, and you do not wish to use the default datum transformation used by projectGeometry:toSpatialReference:.

Supports true curves. Projecting curves located at poles and coordinate system horizons using ArcGIS Runtime may give results that differ slightly from other ArcGIS software because ArcGIS Runtime uses a different geometry projection function.

Parameters
geometryThe geometry to be projected.
toSpatialReferenceThe spatial reference system to project to.
datumTransformationThe datum transformation that describes how coordinates are converted from one coordinate system to another.
Returns
The geometry projected into the given spatial reference. If the input geometry has a nil spatial reference, no projection occurs; instead, an identical geometry with the given spatial reference is returned.
Since
100.2

◆ reshapeGeometry:withPolyline:

+ (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.

Parameters
geometryThe polygon or polyline to be reshaped.
reshaperThe single path polyline reshaper.
Returns
The reshaped polygon or polyline. Returns nil on error.
Since
100.1

◆ simplifyGeometry:

+ (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 self-intersecting, or contain incorrect ring orientations.

Supports true curves.

Parameters
geometryThe geometry to be simplified.
Returns
The simplified geometry.
Since
100

◆ symmetricDifferenceOfGeometry1:geometry2:

+ (nullable AGSGeometry*) symmetricDifferenceOfGeometry1: (AGSGeometry *)  geometry1
geometry2: (AGSGeometry *)  geometry2 

Constructs the set-theoretic symmetric difference between two geometries.

Parameters
geometry1The first geometry.
geometry2The second geometry of dimension equal to or greater than the elements of the first geometry.
Returns
A geometry that represents the difference of the two input geometries.
Since
100

◆ unionGeometries:

+ (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.

Supports true curves.

Parameters
geometriesAn NSArray of geometries.
Returns
The union of all the geometries in the given collection. Returns nil on error.
Since
100.1

◆ unionOfGeometry1:geometry2:

+ (nullable AGSGeometry*) unionOfGeometry1: (AGSGeometry *)  geometry1
geometry2: (AGSGeometry *)  geometry2 

The union operation constructs the set-theoretic union of the two provided geometries.

Supports true curves.

Parameters
geometry1The first geometry.
geometry2The second geometry. Must be of same type as first geometry.
Returns
The union of both the input geometries.
Since
100