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

Description

Represents a single part of a multipart geometry (AGSPolygon or AGSPolyline).

A collection of AGSSegment objects that together represent a part in an AGSMultipart geometry. You can also access the AGSPoint objects that represent the vertices of the geometry (that is, the ends of each segment), using point-based helpers such as AGSPart::pointWithPointIndex:.

Prior to v100.12, the only supported segment type was AGSLineSegment. If the underlying geometry contained curve segments (AGSGeometry::hasCurves is YES) then the curve information was lost when iterating through the segments in that part.

From v100.12, curve segments may be returned from AGSPart::segmentWithSegmentIndex:. A part may contain a mix of linear and curve segments.

This class adopts NSFastEnumeration which permits the part's segments to be enumerated conveniently using a for-in loop. For example -

let part:AGSPart = ... //A part containing segments
for segment in part {
//do something
}
Represents a single part of a multipart geometry (AGSPolygon or AGSPolyline).
Definition: AGSPart.h:67

This class also provides subscripting support. So you can access segments using the subscript syntax. For example -

let part:AGSMutablePart = ... //A part containing segments
let segment = part[0] //The segment at 0th index
A mutable part of a multipart geometry.
Definition: AGSMutablePart.h:67
Since
100
Inheritance diagram for AGSPart:
AGSObject

Instance Methods

(NSArray< AGSSegment * > *) - array
 
(NSInteger) - endPointIndexForSegmentIndex:
 
(AGSSegment *) - objectAtIndexedSubscript:
 
(AGSPoint *) - pointAtIndex:
 
(AGSEnumerator *) - pointEnumerator
 
(AGSSegment *) - segmentAtIndex:
 
(AGSEnumerator *) - segmentEnumerator
 
(NSInteger) - segmentIndexForEndPointIndex:
 
(void) - segmentIndexForPointIndex:outSegmentStartPointIndex:outSegmentEndPointIndex:
 
(NSInteger) - segmentIndexForStartPointIndex:
 
(NSInteger) - startPointIndexForSegmentIndex:
 

Properties

BOOL empty
 
AGSPointendPoint
 
BOOL hasCurves
 
NSInteger pointCount
 
AGSPointCollectionpoints
 
NSInteger segmentCount
 
AGSSpatialReferencespatialReference
 
AGSPointstartPoint
 

Method Documentation

◆ array

- (NSArray<AGSSegment*>*) array

Returns an array of segments.

Since
100

◆ endPointIndexForSegmentIndex:

- (NSInteger) endPointIndexForSegmentIndex: (NSInteger)  segmentIndex

Position of ending vertex for the specified segment.

Parameters
segmentIndexrepresenting the position of the segment whose ending vertex is desired.
Returns
Position of the ending vertex. 0 is the first position.
Since
100

◆ objectAtIndexedSubscript:

- (AGSSegment*) objectAtIndexedSubscript: (NSInteger)  idx

Returns the segment at the specified index. Supports accessing an individual segment using array-style subscript expressions.

For example -

let part:AGSPart = ... //A part containing segments
let segment = part[0] //The segment at 0th index
Parameters
idxsubscript index.
Returns
A segment at subscript index.
Since
100

◆ pointAtIndex:

- (AGSPoint*) pointAtIndex: (NSInteger)  index

Vertex at specified position in the part.

Parameters
indexof desired position. 0 is the first position.
Since
100

◆ pointEnumerator

- (AGSEnumerator*) pointEnumerator

Returns an enumerator object that lets you access each vertex in the part.

Since
100

◆ segmentAtIndex:

- (AGSSegment*) segmentAtIndex: (NSInteger)  index

Segment at specified position in the part.

Parameters
indexof desired position. 0 is the first position.
Since
100

◆ segmentEnumerator

- (AGSEnumerator*) segmentEnumerator

Returns an enumerator object that lets you access each segment in the part.

Since
100

◆ segmentIndexForEndPointIndex:

- (NSInteger) segmentIndexForEndPointIndex: (NSInteger)  pointIndex

Position of segment that contains the specified vertex as its ending point.

Parameters
pointIndexrepresenting the position of vertex which serves as the ending point for the segment.
Returns
Position of segment. 0 is the first position.
Since
100

◆ segmentIndexForPointIndex:outSegmentStartPointIndex:outSegmentEndPointIndex:

- (void) segmentIndexForPointIndex: (NSInteger)  pointIndex
outSegmentStartPointIndex: (NSInteger *)  outSegmentStartPointIndex
outSegmentEndPointIndex: (NSInteger *)  outSegmentEndPointIndex 

◆ segmentIndexForStartPointIndex:

- (NSInteger) segmentIndexForStartPointIndex: (NSInteger)  pointIndex

Position of segment that contains the specified vertex as its starting point.

Parameters
pointIndexrepresenting the position of vertex which serves as the starting point for the segment.
Returns
Position of segment. 0 is the first position.
Since
100

◆ startPointIndexForSegmentIndex:

- (NSInteger) startPointIndexForSegmentIndex: (NSInteger)  segmentIndex

Position of staring vertex for the specified segment.

Parameters
segmentIndexrepresenting the position of the segment whose starting vertex is desired.
Returns
Position of the starting vertex. 0 is the first position.
Since
100

Property Documentation

◆ empty

- (BOOL) empty
readnonatomicassign

Indicates whether the part contains any segments.

Since
100

◆ endPoint

- (AGSPoint*) endPoint
readnonatomicstrong

Ending vertex of the last segment in the part.

Since
100

◆ hasCurves

- (BOOL) hasCurves
readnonatomicassign

Indicates whether this geometry has curves.

Prior to v100.12, if this property was YES, there was no way to access the curve segment information contained by the part. Retrieving the AGSSegment instances of the part would return only AGSLineSegment instances.

From v100.12, when this property is YES, curve segments may be returned from AGSPart::segmentWithSegmentIndex:. A part may contain a mix of linear and curve segments.

See also
AGSGeometry::hasCurves
Since
100

◆ pointCount

- (NSInteger) pointCount
readnonatomicassign

Number of vertices in the part. Each segment contains 2 vertices (start and end). Connected segments can share a vertex.

Since
100

◆ points

- (AGSPointCollection*) points
readnonatomicstrong

All the vertices in this part.

Since
100

◆ segmentCount

- (NSInteger) segmentCount
readnonatomicassign

Number of segments in the part

Since
100

◆ spatialReference

- (AGSSpatialReference*) spatialReference
readnonatomicstrong

The spatial reference associated with segments and vertices in this part. It specifies the coordinate system for each segment and vertex's x & y coordinate values. All segments and vertices that belong to this part must have the same spatial reference, or if they don't have a spatial reference, it will be assumed that they contain coordinates that match this spatial reference.

Since
100
Note
Geometries that represent geographic locations should always have a spatial reference. Otherwise the coordinates of the geometry are meaningless.

◆ startPoint

- (AGSPoint*) startPoint
readnonatomicstrong

Starting vertex of the first segment in the part.

Since
100