ArcGIS Runtime SDK for iOS: AGSMutablePointCollection Class Reference
ArcGIS Runtime SDK for iOS  100.15
All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Modules Pages
AGSMutablePointCollection Class Reference

Description

Mutable collection of points of a multipoint geometry builder.

Instances of this class represent a mutable collection of points of a multipoint geometry builder (AGSMultipointBuilder).

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

let collection:AGSMutablePointCollection = ... //A collection of points
for point in collection {
//do something
}
Mutable collection of points of a multipoint geometry builder.
Definition: AGSMutablePointCollection.h:59

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

let collection:AGSMutablePointCollection = ... //A collection of points
let point = collection[0] //The point at 0th index
collection[0] = newPoint //Replace point at 0th index
Since
100
See also
AGSMultipointBuilder for multipoint geometry builder
Inheritance diagram for AGSMutablePointCollection:
AGSObject

Instance Methods

(NSInteger) - addPoint:
 
(void) - addPoints:
 
(NSInteger) - addPointWithX:y:
 
(NSInteger) - addPointWithX:y:z:
 
(NSArray< AGSPoint * > *) - array
 
(void) - enumerateXYCoordinatesUsingBlock:
 
(NSInteger) - indexOfPoint:
 
(instancetype) - initWithSpatialReference:
 
(void) - insertPoint:atIndex:
 
(void) - insertPointWithX:y:atIndex:
 
(void) - insertPointWithX:y:z:atIndex:
 
(AGSPoint *) - objectAtIndexedSubscript:
 
(AGSPoint *) - pointAtIndex:
 
(AGSEnumerator *) - pointEnumerator
 
(void) - removeAllPoints
 
(void) - removePointAtIndex:
 
(void) - setObject:atIndexedSubscript:
 
(void) - setPoint:atIndex:
 

Class Methods

(instancetype) + pointCollectionWithSpatialReference:
 

Properties

NSInteger count
 
BOOL isEmpty
 
AGSSpatialReferencespatialReference
 

Method Documentation

◆ addPoint:

- (NSInteger) addPoint: (AGSPoint *)  point

Add a point to the end of this collection.

Parameters
pointto add.
Returns
position where point was added. 0 is the first position.
Since
100

◆ addPoints:

- (void) addPoints: (NSArray< AGSPoint * > *)  points

Add points from the provided array to the end of this collection.

Parameters
pointsto add.
Since
100

◆ addPointWithX:y:

- (NSInteger) addPointWithX: (double)  x
y: (double)  y 

Add a point to the end of this collection.

Parameters
xcoordinate of the point.
ycoordinate of the point.
Returns
position where point was added. 0 is the first position.
Since
100

◆ addPointWithX:y:z:

- (NSInteger) addPointWithX: (double)  x
y: (double)  y
z: (double)  z 

Add a point to the end of this collection.

Parameters
xcoordinate of the point.
ycoordinate of the point.
zcoordinate of the point.
Returns
Position where point was added. 0 is the first position.
Since
100

◆ array

- (NSArray<AGSPoint*>*) array

Returns an array of points.

Since
100

◆ enumerateXYCoordinatesUsingBlock:

- (void) enumerateXYCoordinatesUsingBlock: (void(^)(NSUInteger index, double x, double y))  block

Allows you to enumerate the X and Y coordinates of this point collection with a block. This is faster than other ways of enumerating the part that give out AGSPoint instances.

Since
100.5

◆ indexOfPoint:

- (NSInteger) indexOfPoint: (AGSPoint *)  point

Returns the index of the specified point.

Parameters
pointwhose index needs to be located.
Returns
An index of specified point.
Since
100

◆ initWithSpatialReference:

- (instancetype) initWithSpatialReference: (nullable AGSSpatialReference *)  spatialReference

Initialize a collection with specified spatial reference. All points that belong to this collection 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.

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

◆ insertPoint:atIndex:

- (void) insertPoint: (AGSPoint *)  point
atIndex: (NSInteger)  index 

Insert a point at the specified position.

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

◆ insertPointWithX:y:atIndex:

- (void) insertPointWithX: (double)  x
y: (double)  y
atIndex: (NSInteger)  index 

Insert a point at the specified position.

Parameters
xcoordinate of the point.
ycoordinate of the point.
indexof desired position. 0 is the first position.
Since
100

◆ insertPointWithX:y:z:atIndex:

- (void) insertPointWithX: (double)  x
y: (double)  y
z: (double)  z
atIndex: (NSInteger)  index 

Insert a point at the specified position.

Parameters
xcoordinate of the point.
ycoordinate of the point.
zcoordinate of the point.
indexof desired position. 0 is the first position.
Since
100

◆ objectAtIndexedSubscript:

- (AGSPoint*) objectAtIndexedSubscript: (NSInteger)  idx

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

let collection:AGSMutablePointCollection = ... //A collection of points
let point = collection[0] //The point at 0th index
Parameters
idxAn index within the bounds of the collection.
Returns
The point located at the index.
Since
100

◆ pointAtIndex:

- (AGSPoint*) pointAtIndex: (NSInteger)  index

Returns the point at the specified index.

Parameters
indexAn index within the bounds of the collection.
Returns
The point located at the index.
Since
100

◆ pointCollectionWithSpatialReference:

+ (instancetype) pointCollectionWithSpatialReference: (nullable AGSSpatialReference *)  spatialReference

Create a new collection with specified spatial reference. All points that belong to this collection 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.

Parameters
spatialReferenceof the collection.
Returns
A new collection of points.
Since
100
Note
Geometries that represent geographic locations should always have a spatial reference. Otherwise the coordinates of the geometry are meaningless.

◆ pointEnumerator

- (AGSEnumerator*) pointEnumerator

Returns an enumerator object that lets you access each object in the point collection.

Since
100

◆ removeAllPoints

- (void) removeAllPoints

Remove all points from this collection.

Since
100

◆ removePointAtIndex:

- (void) removePointAtIndex: (NSInteger)  index

Remove point at specified position.

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

◆ setObject:atIndexedSubscript:

- (void) setObject: (AGSPoint *)  obj
atIndexedSubscript: (NSInteger)  idx 

Sets the point at the specified index. Supports assigning an individual point using array-style subscript expressions. For example -

let collection:AGSMutablePointCollection = ... //A collection of points
collection[0] = newPoint //Replace point at 0th index
Parameters
objsegment to set
idxsubscript index
Since
100

◆ setPoint:atIndex:

- (void) setPoint: (AGSPoint *)  point
atIndex: (NSInteger)  index 

Replace existing point with the specified one.

Parameters
pointto replace with.
indexof point to replace.
Since
100

Property Documentation

◆ count

- (NSInteger) count
readnonatomicassign

The number of points in the collection.

Since
100

◆ isEmpty

- (BOOL) isEmpty
readnonatomicassign

Indicates whether the collection is empty or not.

Since
100

◆ spatialReference

- (AGSSpatialReference*) spatialReference
readnonatomicstrong

The spatial reference associated with points in the collection. It specifies the coordinate system for each point's x & y coordinate values. All points in this collection 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.