ArcGIS Runtime SDK for iOS
100.15
|
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 -
Some operations use geodesic line interpolation rather than planar (Cartesian). Those that use geodesic line interpolation are specified in their descriptions. A geodesic line follows the shortest distance between two points on the Earth's surface when Earth's surface is approximated by a spheroid. When geodesic line interpolation is used, measurements of distance, area and azimuth are accurate with respect to the curved surface of the spheroid.
+ (double) areaOfGeometry: | (AGSGeometry *) | geometry |
Gets the simple area for the AGSGeometry passed in. This is a planar measurement using 2D Cartesian mathematics to compute the area. The 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.
geometry | The geometry to calculate the area for. |
AGSGeometryEngine::areaGeodeticWithGeometry:unit:curveType:
+ (nullable NSArray<AGSPolygon*>*) autoCompleteForExistingBoundaries: | (NSArray< AGSGeometry * > *) | existingBoundaries | |
newBoundaries: | (NSArray< AGSPolyline * > *) | newBoundaries | |
Fills the closed gaps between polygons using polygon boundaries and polylines as the boundary for the new polygons.
The new polygons are created in the closed empty areas bounded by the edges of the existing polygon boundaries and the new boundary polylines. The newly created polygons do not overlap any existing polygons or polylines, and the boundary of a new polygon must contain at least one edge from the polylines. Only polygons that intersect the input polylines will participate in the operation, so it makes sense to prefilter the input accordingly. The geometries in existingBoundaries must all have an area, i.e. be polygons or envelopes. The geometries in newBoundaries must all be polylines. The geometries in existingBoundaries and newBoundaries must have consistent spatial references.
existingBoundaries | The polygons. |
newBoundaries | The polylines. |
existingBoundaries
or newBoundaries
is empty, returns an empty array. Returns nil
on error. + (nullable AGSGeometry*) boundaryOfGeometry: | (AGSGeometry *) | geometry |
Calculates the boundary of the given geometry.
Supports true curves.
geometry | A geometry object. |
+ (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
geometries | A collection of geometries. |
distances | The 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. |
unionResults | Returns a single geometry that buffers all the geometries (YES ), or one buffer for each in the given collection (NO ). |
unionResults
is YES
, there will be only a single polygon in the resulting collection. Returns nil
on error https://developers.arcgis.com/documentation/spatial-references/
for more information about spatial references. + (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.
geometry | Specifies the input geometry. |
distance | The distance (in the unit of the geometry's spatial reference) by which to buffer the geometry. |
nil
on error. AGSUnit::convert:fromUnit:
and AGSUnit::convert:toUnit:
to convert values between different units + (nullable AGSGeometry*) clipGeometry: | (AGSGeometry *) | geometry | |
withEnvelope: | (AGSEnvelope *) | envelope | |
Constructs the polygon created by clipping geometry by envelope.
Supports true curves.
geometry | The geometry to be clipped by the given envelope. |
envelope | The envelope in which to use in order to clip geometry. |
+ (nullable AGSEnvelope*) combineExtentsOfGeometries: | (NSArray< AGSGeometry * > *) | geometries |
Returns the combined envelope of geometries in the given array.
The geometries must have consistent spatial references.
Supports true curves.
geometries | An NSArray of geometries. |
nil
on error. + (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.
geometry1 | A geometry object. |
geometry2 | Another geometry object. |
+ (nullable NSArray<AGSGeometry*>*) convexHullForGeometries: | (NSArray< AGSGeometry * > *) | geometries | |
mergeInputs: | (BOOL) | mergeInputs | |
Returns the convex hull for the geometries in the given array.
The geometries must have consistent spatial references.
geometries | An NSArray of geometries. |
mergeInputs | Return a single geometry that encloses all the geometries (YES ), or one enclosing geometry for each in the collection (NO ). |
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. + (nullable AGSGeometry*) convexHullForGeometry: | (AGSGeometry *) | geometry |
Returns the minimum bounding geometry that completely encloses the given geometry.
geometry | for which convex hull needs to be calculated. Typically either an AGSMultipoint , AGSPolygon , or AGSPolyline . |
+ (nullable NSArray<AGSGeometry *> *) cutGeometry: | (AGSGeometry *) | geometry | |
withCutter: | (AGSPolyline *) | cutter | |
Cut the 'geometry' with the 'cutter'. The cutter and geometry's spatial references must match. When cutting an AGSPolyline
, all left cuts will be grouped together in the first AGSGeometry
, right cuts and coincident cuts are grouped in the second AGSGeometry
, and each undefined cut, along with any uncut parts, are output as separate AGSPolylines
. When cutting an AGSPolygon
, all left cuts are grouped in the first AGSGeometry
, all right cuts are in the second AGSGeometry
, and each undefined cut, along with any 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.
geometry | to cut. |
cutter | polyline to cut with. |
+ (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.
geometry | An AGSPolyline or AGSPolygon geometry. |
maxSegmentLength | The 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. |
+ (nullable AGSGeometry*) differenceOfGeometry1: | (AGSGeometry *) | geometry1 | |
geometry2: | (AGSGeometry *) | geometry2 | |
Constructs the set-theoretic difference between two geometries.
Supports true curves.
geometry1 | The first geometry. |
geometry2 | The second geometry. Must be of same type as first geometry. |
+ (double) distanceBetweenGeometry1: | (AGSGeometry *) | geometry1 | |
geometry2: | (AGSGeometry *) | geometry2 | |
Measures the simple planar distance between two geometries. 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:
.
geometry1 | The first geometry. |
geometry2 | The second geometry. |
+ (nullable AGSPolyline*) extendPolyline: | (AGSPolyline *) | polyline | |
withPolyline: | (AGSPolyline *) | extender | |
options: | (AGSGeometryExtendOption) | options | |
Extends a polyline using a polyline as the extender.
The output polyline will have the first and last segment of each path extended to the extender if the segments can be interpolated to intersect the extender. In the case that the segments can be extended to multiple segments of the extender, the shortest extension is chosen. Only end points for paths that are not shared by the end points of other paths will be extended. If the polyline cannot be extended by the input extender, then nil
will be returned.
polyline | The polyline to be extended. |
extender | The polyline to extend to. |
options | The flags for the type of extend operation to perform. |
nil
on error. + (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.
line | The line to locate the point's distance along its length. |
point | The point to locate. |
tolerance | The 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. |
0.0
and 1.0
, or NAN
if the point is outside the tolerance. + (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.
geometry | The input geometry. |
maxDeviation | The maximum distance that the generalized geometry can deviate from the original one, specified in the units of the input geometry's spatial reference. |
removeDegenerateParts | If YES , degenerate parts of the generalized geometry that are undesired for drawing will be removed. |
+ (nullable AGSGeometry*) geodesicEllipseWithParameters: | (AGSGeodesicEllipseParameters *) | params |
Constructs a geodesic ellipse that is centered on a specified point and defined by it's 2 axes and the direction of it's longest axis. The ellipse is provided as a AGSPolygon, AGSPolyline or AGSMultipoint geometry.
params | Specifies the parameters for constructing the ellipse. |
+ (nullable AGSGeometry*) geodesicSectorWithParameters: | (AGSGeodesicSectorParameters *) | params |
Constructs a geodesic sector defined by a geodesic arc and 2 radii. The arc is a portion of an ellipse that is centered on a specified point and is defined by it's 2 axes and the length of it's longest axis. The first radius angle is defined by the startDirection angle and the second radius angle is the sum of the startDirection and the sectorAngle. The sector is constructed as a AGSPolygon, AGSPolyline or AGSMultipoint geometry.
params | Specifies the parameters for constructing the sector. |
+ (double) geodeticAreaOfGeometry: | (AGSGeometry *) | geometry | |
areaUnit: | (AGSAreaUnit *) | areaUnit | |
curveType: | (AGSGeodeticCurveType) | curveType | |
Gets the geodetic area for the AGSGeometry passed in. Will return NAN
if the calculation results in a linear to angular conversion (for instance, Decimal Degrees to Meters)
Supports true curves, calculating the result by densifying curves.
geometry | The geometry to calculate the area for. |
areaUnit | The unit at which the area is calculated. |
curveType | The type of geodetic curve. |
+ (nullable NSArray<AGSGeometry*>*) geodeticBufferGeometries: | (NSArray< AGSGeometry * > *) | geometries | |
distances: | (NSArray< NSNumber * > *) | distances | |
distanceUnit: | (AGSLinearUnit *) | distanceUnit | |
maxDeviation: | (double) | maxDeviation | |
curveType: | (AGSGeodeticCurveType) | curveType | |
unionResults: | (BOOL) | unionResults | |
Calculates the geodesic buffer of the geometries in a given array.
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.
geometries | An NSArray of geometries. |
distances | The 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. |
distanceUnit | The unit of measure for the distance. |
maxDeviation | The maximum deviation between points. |
curveType | The curve type to calculate. |
unionResults | Return a single geometry that buffers all the geometries (YES ), or one buffer for each in the given collection (NO ). |
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. + (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.
geometry | The input geometry. |
distance | The distance by which to buffer the geometry. |
distanceUnit | in which the distance is specified. |
maxDeviation | the maximum distance that the generalized buffer geometry can deviate from the original one, specified in the units of distanceUnit . Can be NAN for default behavior, or must be a value between 0.001 and 0.5*abs(distance ). |
curveType | The type of geodetic curve. AGSGeodeticCurveTypeShapePreserving is a good option for most cases. |
+ (nullable AGSGeometry*) geodeticDensifyGeometry: | (AGSGeometry *) | geometry | |
maxSegmentLength: | (double) | maxSegmentLength | |
lengthUnit: | (AGSLinearUnit *) | lengthUnit | |
curveType: | (AGSGeodeticCurveType) | curveType | |
Densifies the input geometry by creating additional vertices along the geometry, using a geodesic curve.
geometry | The input geometry. |
maxSegmentLength | The maximum distance between vertices when the input geometry is densified. |
lengthUnit | The unit that the max segment length parameter is in. |
curveType | The type of geodetic curve. |
+ (nullable AGSGeodeticDistanceResult*) geodeticDistanceBetweenPoint1: | (AGSPoint *) | point1 | |
point2: | (AGSPoint *) | point2 | |
distanceUnit: | (AGSLinearUnit *) | distanceUnit | |
azimuthUnit: | (AGSAngularUnit *) | azimuthUnit | |
curveType: | (AGSGeodeticCurveType) | curveType | |
Returns the geodetic distance between 2 given points and calculates the azimuth at both points for the geodetic curves that connects the points.
point1 | The first point. |
point2 | The second point. |
distanceUnit | The linear units of the distance returned in the AGSGeodeticDistanceResult object. |
azimuthUnit | The angular unit of the azimuth returned in the AGSGeodeticDistanceResult object. |
curveType | The type of geodetic curve. |
+ (double) geodeticLengthOfGeometry: | (AGSGeometry *) | geometry | |
lengthUnit: | (AGSLinearUnit *) | lengthUnit | |
curveType: | (AGSGeodeticCurveType) | curveType | |
Gets the geodetic length for the AGSGeometry passed in. The length is calculated using only the vertices of the polygon and define the lines between the points as geodesic segments independent of the actual shape of the polygon. A geodesic segment is the shortest path between two points on an ellipsoid. Thus, if you have a line that spans the width of the world, with only two vertices, each on the edges of the map, the geodesic length would be zero (shortest distance between the two vertices).
Will return NAN
if the calculation results in a linear to angular conversion (for instance, decimal degrees to meters).
Supports true curves, calculating the result by densifying curves.
geometry | The geometry to calculate the geodetic length for. |
lengthUnit | The unit at which the length is calculated. |
curveType | The type of geodetic curve. |
+ lengthOfGeometry:
+ (nullable NSArray<AGSPoint*>*) geodeticMovePoints: | (NSArray< AGSPoint * > *) | points | |
distance: | (double) | distance | |
distanceUnit: | (AGSLinearUnit *) | distanceUnit | |
azimuth: | (double) | azimuth | |
azimuthUnit: | (AGSAngularUnit *) | azimuthUnit | |
curveType: | (AGSGeodeticCurveType) | curveType | |
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.
points | An array of AGSPoint geometries. |
distance | The distance by which the points are moved. |
distanceUnit | The linear units of the distance. The default is AGSSRUnitMeter. |
azimuth | The azimuth for the points to be moved along. |
azimuthUnit | The angular unit of the azimuth. |
curveType | The type of geodetic curve. |
+ (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.
geometry | A geometry object on which to calculate the nearest coordinate to the point parameter. |
point | The point from which to calculate the nearest coordinate on the geometry parameter. |
maxDeviation | The maximum distance that the geodesic geometry can deviate from the original, in the units of the deviationUnit parameter. |
deviationUnit | The unit of measure for the maxDeviation parameter. If nil , the units of maxDeviation are assumed to be meters. |
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. + (BOOL) geometry: | (AGSGeometry *) | geometry1 | |
containsGeometry: | (AGSGeometry *) | geometry2 | |
Returns YES
if geometry1
contains geometry2
.
Supports true curves.
+ (BOOL) geometry: | (AGSGeometry *) | geometry1 | |
crossesGeometry: | (AGSGeometry *) | geometry2 | |
Returns YES
if geometry1
crosses geometry2
.
Supports true curves.
+ (BOOL) geometry: | (AGSGeometry *) | geometry1 | |
disjointToGeometry: | (AGSGeometry *) | geometry2 | |
Returns YES
if geometry1
is disjoint to geometry2
.
Supports true curves.
+ (BOOL) geometry: | (AGSGeometry *) | geometry1 | |
equalsGeometry: | (AGSGeometry *) | geometry2 | |
Returns YES
if geometry1
is equal to geometry2
.
Supports true curves.
+ (BOOL) geometry: | (AGSGeometry *) | geometry1 | |
intersectsGeometry: | (AGSGeometry *) | geometry2 | |
Returns YES
if geometry1
intersects geometry2
.
Supports true curves.
+ (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.
+ (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:
Supports true curves.
geometry1 | The input geometry to be compared. |
geometry2 | The input geometry in which we are comparing geometry1 against. |
relation | The DE-9IM 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
.
Supports true curves.
+ (BOOL) geometry: | (AGSGeometry *) | geometry1 | |
withinGeometry: | (AGSGeometry *) | geometry2 | |
Returns YES
if geometry1
is completely within geometry2
.
Supports true curves.
+ (AGSGeometry*) geometryByRemovingMFromGeometry: | (AGSGeometry *) | geometry |
Return a copy of the given geometry with its M values removed.
Supports true curves.
geometry | A geometry. |
nil
on error. + (AGSGeometry*) geometryByRemovingZAndMFromGeometry: | (AGSGeometry *) | geometry |
Return a copy of the given geometry with its Z coordinate and M values removed.
Supports true curves.
geometry | A geometry. |
nil
on error. + (AGSGeometry*) geometryByRemovingZFromGeometry: | (AGSGeometry *) | geometry |
Return a copy of the given geometry with its Z coordinate removed.
Supports true curves.
geometry | A geometry. |
nil
on error. + (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.
m | The M value. |
geometry | A geometry. |
nil
on error. + (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.
z | The Z coordinate. |
geometry | A geometry. |
nil
on error. + (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.
z | The Z coordinate. |
m | The M value. |
geometry | A geometry. |
nil
on error. + (BOOL) geometryIsSimple: | (AGSGeometry *) | geometry |
Returns YES
if geometry
is topologically simple.
Supports true curves.
+ (nullable AGSGeometry*) intersectionOfGeometry1: | (AGSGeometry *) | geometry1 | |
geometry2: | (AGSGeometry *) | geometry2 | |
Constructs the set-theoretic intersection between two geometries.
Supports true curves.
geometry1 | The first geometry. |
geometry2 | The second geometry. Must be of same type as first geometry. |
+ (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.
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.
geometry1 | A geometry object. |
geometry2 | Another geometry object. |
+ (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.
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:
Supports true curves.
geometry | The geometry to calculate the length for. |
+ (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.
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
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. + (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.
geometry | The geometry in which the nearest vertex to a specified point is to be found. |
point | The point which to find the nearest vertex to. |
+ (nullable AGSGeometry*) normalizeCentralMeridianOfGeometry: | (AGSGeometry *) | geometry |
Folds the geometry into a range of 360 degrees. This may be necessary when wrap around is enabled on the map.
Supports true curves.
geometry | The geometry that you want folded. |
+ (nullable AGSGeometry*) offsetGeometry: | (AGSGeometry *) | geometry | |
distance: | (double) | distance | |
offsetType: | (AGSGeometryOffsetType) | offsetType | |
bevelRatio: | (double) | bevelRatio | |
flattenError: | (double) | flattenError | |
Creates offset version of the input geometries.
The offset operation creates a geometry that is a constant distance from an input polyline or polygon. It is similar to buffering, but produces a one sided result. If offsetDistance > 0, then the offset geometry is constructed to the right of the oriented input geometry, otherwise it is constructed to the left. For a simple polygon, the orientation of outer rings is clockwise and for inner rings it is counter clockwise. So the “right side” of a simple polygon is always its inside. The bevelRatio is multiplied by the offset distance and the result determines how far a mitered offset intersection can be from the input curve before it is beveled.
geometry | The geometry to calculate offset for. Point and MultiPoint are not supported. |
distance | The offset distance for the Geometries. |
offsetType | The join type of the offset geometry. |
bevelRatio | The ratio used to produce a bevel join instead of a miter join (used only when joins is Miter). |
flattenError | The maximum distance of the resulting segments compared to the true circular arc (used only when joins is Round). If flattenError is 0, tolerance value is used. Also, the algorithm never produces more than around 180 vetices for each round join. |
+ (nullable AGSPoint *) pointAlongPolyline: | (AGSPolyline *) | polyline | |
distance: | (double) | distance | |
Returns the point at the given distance along the line. If distance is less than or equal to zero, the point returned is coincident with the start of the line. If distance
is greater than or equal to the line's length, the point returned is coincident with the end of the line. If the line has multiple parts, and the distance falls exactly on a boundary between two parts, the returned point will be coincident with either the end of one part or the start of the next–which is undetermined.
Supports true curves.
polyline | A line. |
distance | The distance along the line of the point to return, in the line's units. |
nil
if an error ocurred. + (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.
geometry | The geometry to be projected. |
spatialReference | The spatial reference to which geometry need to be projected. |
nil
spatial reference, no projection occurs; instead, an identical geometry with the given spatial reference is returned. + (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.
geometry | The geometry to be projected. |
toSpatialReference | The spatial reference system to project to. |
datumTransformation | The datum transformation that describes how coordinates are converted from one coordinate system to another. |
nil
spatial reference, no projection occurs; instead, an identical geometry with the given spatial reference is returned. + (nullable AGSMultipart*) reshapeGeometry: | (AGSMultipart *) | geometry | |
withPolyline: | (AGSPolyline *) | reshaper | |
Reshape polygons or polylines with a single path polyline.
Performs the reshape operation on a polygon or polyline using a single path polyline as the reshaper. The output geometry takes the shape of the Multi_path where it first intersects the reshaper to the last intersection. The first and last intersection points of the reshaper are chosen closest to the end points of the reshaper in the case that multiple intersections are found. For polygons, only individual paths can be reshaped. However, polylines can be reshaped across paths. If the geometry cannot be reshaped by the input reshaper, then nil
will be returned.
geometry | The polygon or polyline to be reshaped. |
reshaper | The single path polyline reshaper. |
nil
on error. + (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.
geometry | The geometry to be simplified. |
+ (nullable AGSGeometry*) symmetricDifferenceOfGeometry1: | (AGSGeometry *) | geometry1 | |
geometry2: | (AGSGeometry *) | geometry2 | |
Constructs the set-theoretic symmetric difference between two geometries.
geometry1 | The first geometry. |
geometry2 | The second geometry of dimension equal to or greater than the elements of the first geometry. |
+ (nullable AGSGeometry*) unionGeometries: | (NSArray< AGSGeometry * > *) | geometries |
Calculates the union of an array of geometries.
There must be at least one geometry in the given array. The geometries must have consistent spatial references. If the array contains geometries of differing dimensionality, returns the union of the subset of geometries with the highest dimensionality. E.g. given a collection of polygons, polylines and points, returns the union of the polygons.
Supports true curves.
geometries | An NSArray of geometries. |
nil
on error. + (nullable AGSGeometry*) unionOfGeometry1: | (AGSGeometry *) | geometry1 | |
geometry2: | (AGSGeometry *) | geometry2 | |
The union operation constructs the set-theoretic union of the two provided geometries.
Supports true curves.
geometry1 | The first geometry. |
geometry2 | The second geometry. Must be of same type as first geometry. |