ArcGIS Runtime SDK for macOS: AGSGeometryEngine Class Reference
ArcGIS Runtime SDK for macOS  100.5
AGSGeometryEngine Class Reference

Description

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.

See also
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:
 
(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:
 
(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 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:

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
+ geodeticAreaOfGeometry:areaUnit:curveType:

§ 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

§ bufferGeometries:distances:unionResults:()

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

Parameters
geometriesA collection of geometries.
distancesThe 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.
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 buffer at the desired distance(s) around the given geometries. If 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.
Since
100.1

§ bufferGeometry:byDistance:()

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

Creates a buffer polygon at the specified distance around the given geometry.

Parameters
geometrySpecifies the input geometry.
distanceThe distance (in the unit of the geometry's spatial reference) by which to buffer the geometry.
Returns
The polygon that represents the buffered area.
Since
100
See also
AGSUnit::convert:fromUnit: and AGSUnit::convert:toUnit: to convert values between different units

§ clipGeometry:withEnvelope:()

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

Constructs the polygon created by clipping geometry by envelope.

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.

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.

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

Parameters
geometryto cut
cutterpolyline to cut with
Since
100

§ densifyGeometry:maxSegmentLength:()

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

Densifies the input geometry by plotting points between existing vertices.

Parameters
geometryThe input geometry
maxSegmentLengthThe maximum distance between points after densification. This distance should be in the same unit as the geometry's spatial reference.
Returns
The densified geometry.
Since
100

§ differenceOfGeometry1:geometry2:()

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

Constructs the set-theoretic difference between two geometries.

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.

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

§ 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

§ 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.

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)

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.

Parameters
geometriesAn NSArray of geometries.
distancesThe 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.
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) around the given geometries. If 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, 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.

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 plotting points between existing vertices.

Parameters
geometryThe input geometry
maxSegmentLengthThe maximum distance between points after densification.
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)

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 

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.

Parameters
pointsAn array of points to be moved.
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

§ geometry:containsGeometry:()

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

Returns YES if geometry1 contains geometry2.

Since
100

§ geometry:crossesGeometry:()

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

Returns YES if geometry1 crosses geometry2.

Since
100

§ geometry:disjointToGeometry:()

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

Returns YES if geometry1 is disjoint to geometry2.

Since
100

§ geometry:equalsGeometry:()

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

Returns YES if geometry1 is equal to geometry2.

Since
100

§ geometry:intersectsGeometry:()

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

Returns YES if geometry1 intersects geometry2.

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 TRUE if their intersection results in a geometry different from both but of the same dimension.

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

Since
100

§ geometry:withinGeometry:()

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

Returns YES if geometry1 is completely within geometry2.

Since
100

§ geometryByRemovingMFromGeometry:()

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

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

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 ordinate and M values removed.

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 ordinate removed.

Parameters
geometryA geometry.
Returns
A copy of the given geometry with its Z ordinate 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 hasM true.

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

Parameters
zThe Z ordinate.
geometryA geometry.
Returns
A copy of the given geometry with its Z ordinates 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 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.

Parameters
zThe Z ordinate.
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.

Since
100

§ intersectionOfGeometry1:geometry2:()

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

Constructs the set-theoretic intersection between two geometries.

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

§ 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.

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:

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 

Finds the nearest coordinate in a specified geometry to a specified point.

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
The proximity result.
Since
100

§ nearestVertexInGeometry:toPoint:()

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

Finds the nearest vertex in a specified geometry to a specified point.

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.

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.

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 into a new spatial reference.

Parameters
geometryThe geometry to be projected.
spatialReferenceThe spatial reference to which geometry need to be projected.
Returns
The projected geometry
Since
100

§ 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.

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.

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.

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