10.2.5

Instances of this class represents engines that can perform geometric operations locally on the device. AGSGeometryEngine
is functionally similar to AGSGeometryServiceTask
except that it does not rely on a remote ArcGIS Geometry Service. You can use the engine even when the device does not have any network connectivity.
Class Methods  
(AGSGeometryEngine *)  + defaultGeometryEngine 
 (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. 
 (AGSMutablePolygon*) bufferGeometries:  (NSArray *)  geometries  
byDistance:  (double)  distance  
Creates buffers at the specified distance around the given geometries. Will union the results of all buffers.
geometries  Specifies the input geometries. 
distance  The distance in the unit of the geometry's spatial reference for which to buffer the geometries. 
 convertValue:fromUnit: (AGSSpatialReference)
and  convertValue:toUnit: (AGSSpatialReference)
to convert values between different units  (AGSMutablePolygon*) 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 for which to buffer the geometry. 
 convertValue:fromUnit: (AGSSpatialReference)
and  convertValue:toUnit: (AGSSpatialReference)
to convert values between different units  (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. 
 (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 . 
 (NSArray*) cutGeometry:  (AGSGeometry *)  geometry  
withCutter:  (AGSPolyline *)  cutter  
Splits the input polyline or polygon where it crosses a cutting polyline.
geometry  The geometry to be cut. 
cutter  The polyline that will be used to divide the target into pieces where it crosses the target. 
+ (AGSGeometryEngine*) defaultGeometryEngine 
A singleton geometry engine that can be used. Since an instance of a geometry engine caches state, like the last projection transformation used, it may be beneficial to create one for each spatial reference that you are dealing with, instead of using this.
 (AGSGeometry*) densifyGeometry:  (AGSGeometry *)  geometry  
withMaxSegmentLength:  (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. 
 (AGSGeometry*) differenceOfGeometry:  (AGSGeometry *)  geometry1  
andGeometry:  (AGSGeometry *)  geometry2  
Constructs the settheoretic 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. 
 (double) distanceFromGeometry:  (AGSGeometry *)  geometry1  
toGeometry:  (AGSGeometry *)  geometry2  
Measures the simple planar distance between two geometries.
geometry1  The first geometry. 
geometry2  The second geometry. 
 (AGSGeometry*) generalizeGeometry:  (AGSGeometry *)  geometry  
withMaxDeviation:  (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. 
 (double) geodesicAreaOfGeometry:  (AGSGeometry *)  geometry  
inUnit:  (AGSAreaUnits)  areaUnit  
Gets the geodesic 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. 
 (AGSGeometry*) geodesicDensifyGeometry:  (AGSGeometry *)  geometry  
withMaxSegmentLength:  (double)  maxSegmentLength  
inUnit:  (AGSSRUnit)  lengthUnit  
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. 
 (AGSGeodesicDistanceResult*) geodesicDistanceBetweenPoint1:  (AGSPoint *)  point1  
point2:  (AGSPoint *)  point2  
inUnit:  (AGSSRUnit)  unit  
Returns the geodesic distance between 2 given points and calculates the azimuth at both points for the geodesic curves that connects the points.
point1  The first point 
point2  The second point 
unit  The linear units of the distance returned in the AGSGeodesicDistanceResult object 
 (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. 
 (double) geodesicLengthOfGeometry:  (AGSGeometry *)  geometry  
inUnit:  (AGSSRUnit)  lengthUnit  
Gets the geodesic length for the AGSGeometry passed in. Geodesic 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 lenght 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 geodesic length for. 
lengthUnit  The unit at which the area is calculated. 
 (NSArray*) geodesicMovePoints:  (NSArray *)  points  
byDistance:  (double)  distance  
inUnit:  (AGSSRUnit)  unit  
azimuth:  (double)  degrees  
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. 
degrees  The angle for the points to be moved along (in degrees). 
distance  The distance by which the points are moved. 
unit  The linear units of the distance. The default is AGSSRUnitMeter. 
 (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. 
 (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  
intersectsGeometry:  (AGSGeometry *)  geometry2  
Returns YES if geometry1 intersects geometry2.
 (BOOL) geometry:  (AGSGeometry *)  geometry1  
overlapsGeometry:  (AGSGeometry *)  geometry2  
Performs relational operation Overlaps. 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 within geometry2.
 (AGSGeometry*) intersectionOfGeometry:  (AGSGeometry *)  geometry1  
andGeometry:  (AGSGeometry *)  geometry2  
Constructs the settheoretic intersection between two geometries.
geometry1  The first geometry. 
geometry2  The second geometry of dimension equal to or greater than the elements of the first geometry. 
 (AGSMutablePoint*) 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. 
 (NSString*) mgrsFromPoint:  (AGSPoint *)  pt  
numDigits:  (NSInteger)  numDigits  
rounding:  (BOOL)  rounding  
addSpaces:  (BOOL)  addSpaces  
Returns a Military Grid Reference System (MGRS) coordinate for the given point. For example : 4Q 612341 2356781
pt  The point for which MGRS coordinate is needed 
numDigits  The number of digits to be included in the MGRS coordinate 
rounding  Whether the numeric value should be rounded 
addSpaces  Whether the MGRS coordinate string should include spaces 
MGRSStringWithNumDigits:rounding:addSpaces: (AGSPoint(CoordinateConversion))
instead.  (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. 
 (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. 
 (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. 
 (AGSGeometry*) offsetGeometry:  (AGSGeometry *)  geometry  
byDistance:  (double)  distance  
withJointType:  (AGSGeometryOffsetType)  joinType  
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. 
joinType  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. 
 (AGSPoint*) pointFromMGRS:  (NSString *)  mgrs 
Returns a point for a given MGRS coordinate string
mgrs  The MGRS coordinate string. Can contain spaces. 
pointFromMGRSString:withSpatialReference: (AGSPoint(CoordinateConversion))
instead.  (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. 
 (double) shapePreservingAreaOfGeometry:  (AGSGeometry *)  geometry  
inUnit:  (AGSAreaUnits)  areaUnit  
Calculates the area of the geometry on the surface of the Earth ellipsoid. This method preserves the shape of the geometry in its coordinate system. This means the true area will be calculated for the geometry you see in the map.
geometry  whose area needs to be computed 
areaUnit  The unit in which area needs to be computed 
 (double) shapePreservingLengthOfGeometry:  (AGSGeometry *)  geometry  
inUnit:  (AGSSRUnit)  lengthUnit  
Calculates the length of the geometry on the surface of the Earth ellipsoid. This method preserves the shape of the geometry in its coordinate system. This means the true length will be calculated for the geometry you see in the map. Thus, if you have a line that spans the width of the world, with only two vertices, each on edges of the map, the length returned would be comparable to the distance on earth.
geometry  whose length needs to be computed 
lengthUnit  The unit in which length needs to be computed 
 (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. 
 (AGSGeometry*) symmetricDifferenceOfGeometry:  (AGSGeometry *)  geometry1  
andGeometry:  (AGSGeometry *)  geometry2  
 (AGSGeometry*) unionGeometries:  (NSArray *)  geometries 
The union operation constructs the settheoretic union of the geometries in the input array.
geometries  The array of geometries to be unioned. 