Skip To Content ArcGIS for Developers Sign In Dashboard

PointCollection Class

(Esri::ArcGISRuntime::PointCollection)

Represents a mutable collection of Points for creating a Multipoint geometry from a MultipointBuilder. More...

Header: #include <PointCollection>
Since: Esri::ArcGISRuntime 100.0
Inherits: Object and Iterable<Point>

Public Functions

PointCollection(const SpatialReference &spatialReference, QObject *parent = nullptr)
~PointCollection()
int addPoint(const Point &point)
int addPoint(double x, double y)
int addPoint(double x, double y, double z)
void addPoints(const QList<Point> &points)
void addPoints(PointCollection *points)
void addPoints(const ImmutablePointCollection &points)
int indexOf(const Point &point) const
void insertPoint(int pointIndex, const Point &point)
void insertPoint(int pointIndex, double x, double y)
void insertPoint(int pointIndex, double x, double y, double z)
bool isEmpty() const
Point point(int index) const
void removeAll()
void removePoint(int pointIndex)
void setPoint(int pointIndex, const Point &point)
int size() const
SpatialReference spatialReference() const

Additional Inherited Members

Detailed Description

Represents a mutable collection of Points for creating a Multipoint geometry from a MultipointBuilder.

Points can be added to, inserted into, and removed from the collection in order to define or change the shape of the Multipoint.

The spatial reference of any Points added to a PointCollection must match that of this PointCollection, or be unspecified (in which case the Points are assumed to have the same spatial reference as this PointCollection).

Member Function Documentation

PointCollection::PointCollection(const SpatialReference &spatialReference, QObject *parent = nullptr)

Constructor that takes a SpatialReference spatialReference and an optional parent.

PointCollection::~PointCollection()

Destructor.

int PointCollection::addPoint(const Point &point)

Adds point to the collection.

Returns -1 on error.

int PointCollection::addPoint(double x, double y)

Adds a new point with the given x and y coordinates.

Returns the index of the added point, or -1 on error.

The coordinates must be in the spatial reference of this PointCollection.

int PointCollection::addPoint(double x, double y, double z)

Adds a new point to the collection with the given x, y, and z coordinates.

Returns the index of the added point, or -1 on error.

Note: the coordinates must be in the spatial reference of this PointCollection.

void PointCollection::addPoints(const QList<Point> &points)

Adds list of points to the collection.

This function was introduced in Esri::ArcGISRuntime 100.1.

void PointCollection::addPoints(PointCollection *points)

Adds the points in this PointCollection points to this collection.

void PointCollection::addPoints(const ImmutablePointCollection &points)

Adds the points in the ImmutablePointCollection points to this collection.

int PointCollection::indexOf(const Point &point) const

Gets the index of point in the collection.

Returns -1 if the point is not found.

void PointCollection::insertPoint(int pointIndex, const Point &point)

Inserts a point into this PointCollection at pointIndex.

void PointCollection::insertPoint(int pointIndex, double x, double y)

Inserts a point with the given x and y coordinates into this PointCollection at pointIndex.

The coordinates must be in the spatial reference of this PointCollection.

void PointCollection::insertPoint(int pointIndex, double x, double y, double z)

Inserts a point with the given x, y, and z coordinates into this PointCollection at pointIndex.

The coordinates must be in the spatial reference of this PointCollection.

bool PointCollection::isEmpty() const

Gets whether this PointCollection contains any points.

Returns true if this PointCollection contains points.

Point PointCollection::point(int index) const

Gets the point at index.

Returns an empty Point object on error.

See also setPoint().

void PointCollection::removeAll()

Removes all the points from this PointCollection.

void PointCollection::removePoint(int pointIndex)

Removes the point at pointIndex.

void PointCollection::setPoint(int pointIndex, const Point &point)

Reassigns the point at pointIndex to point.

See also point().

int PointCollection::size() const

Gets the number of points in this PointCollection.

SpatialReference PointCollection::spatialReference() const

Gets the SpatialReference of this PointCollection.


Feedback on this topic?