QgsMultiPoint class

Multi point geometry collection.

Base classes

class QgsGeometryCollection
Geometry collection.

Public functions

auto addGeometry(QgsAbstractGeometry* g) -> bool override
Adds a geometry and takes ownership. Returns true in case of success.
auto asGml2(QDomDocument& doc, int precision = 17, const QString& ns = "gml", QgsAbstractGeometry::AxisOrder axisOrder = QgsAbstractGeometry::AxisOrder::XY) const -> QDomElement override
Returns a GML2 representation of the geometry.
auto asGml3(QDomDocument& doc, int precision = 17, const QString& ns = "gml", QgsAbstractGeometry::AxisOrder axisOrder = QgsAbstractGeometry::AxisOrder::XY) const -> QDomElement override
Returns a GML3 representation of the geometry.
auto asJson(int precision = 17) const -> QString override
Returns a GeoJSON representation of the geometry.
auto boundary() const -> QgsAbstractGeometry* override
Returns the closure of the combinatorial boundary of the geometry (ie the topological boundary of the geometry).
auto cast(const QgsAbstractGeometry* geom) const -> const QgsMultiPoint*
Cast the geom to a QgsLineString.
void clear() override
Clears the geometry, ie reset it to a null geometry.
auto clone() const -> QgsMultiPoint* override
Clones the geometry by performing a deep copy.
auto createEmptyWithSameType() const -> QgsMultiPoint* override
Creates a new geometry with the same class and same WKB type as the original and transfers ownership.
void filterVertices(const std::function<bool(const QgsPoint&)>& filter) override
Filters the vertices from the geometry in place, removing any which do not return true for the filter function check.
auto fromWkt(const QString& wkt) -> bool override
Sets the geometry from a WKT string.
auto geometryType() const -> QString override
Returns a unique string representing the geometry type.
auto insertGeometry(QgsAbstractGeometry* g, int index) -> bool override
Inserts a geometry before a specified index and takes ownership.
auto nCoordinates() const -> int override
Returns the number of nodes contained in the geometry.
auto segmentLength(QgsVertexId startVertex) const -> double override
Returns the length of the segment of the geometry which begins at startVertex.
auto toCurveType() const -> QgsMultiPoint* override
Returns the geometry converted to the more generic curve type.
auto vertexNumberFromVertexId(QgsVertexId id) const -> int override
Returns the vertex number corresponding to a vertex id.

Protected functions

auto wktOmitChildType() const -> bool override
Returns whether child type names are omitted from Wkt representations of the collection.

Function documentation

QDomElement QgsMultiPoint::asGml2(QDomDocument& doc, int precision = 17, const QString& ns = "gml", QgsAbstractGeometry::AxisOrder axisOrder = QgsAbstractGeometry::AxisOrder::XY) const override

Returns a GML2 representation of the geometry.

Parameters
doc DOM document
precision number of decimal places for coordinates
ns XML namespace
axisOrder Axis order for generated GML

QDomElement QgsMultiPoint::asGml3(QDomDocument& doc, int precision = 17, const QString& ns = "gml", QgsAbstractGeometry::AxisOrder axisOrder = QgsAbstractGeometry::AxisOrder::XY) const override

Returns a GML3 representation of the geometry.

Parameters
doc DOM document
precision number of decimal places for coordinates
ns XML namespace
axisOrder Axis order for generated GML

QString QgsMultiPoint::asJson(int precision = 17) const override

Returns a GeoJSON representation of the geometry.

Parameters
precision number of decimal places for coordinates

QgsAbstractGeometry* QgsMultiPoint::boundary() const override

Returns the closure of the combinatorial boundary of the geometry (ie the topological boundary of the geometry).

Returns boundary for geometry. May be null for some geometry types.

For instance, a polygon geometry will have a boundary consisting of the linestrings for each ring in the polygon.

const QgsMultiPoint* QgsMultiPoint::cast(const QgsAbstractGeometry* geom) const

Cast the geom to a QgsLineString.

Should be used by qgsgeometry_cast<QgsLineString *>( geometry ).

QgsMultiPoint* QgsMultiPoint::createEmptyWithSameType() const override

Creates a new geometry with the same class and same WKB type as the original and transfers ownership.

To create it, the geometry is default constructed and then the WKB is changed.

void QgsMultiPoint::filterVertices(const std::function<bool(const QgsPoint&)>& filter) override

Filters the vertices from the geometry in place, removing any which do not return true for the filter function check.

Has no meaning when called on a single point geometry.

Depending on the filter used, this may result in an invalid geometry.

bool QgsMultiPoint::fromWkt(const QString& wkt) override

Sets the geometry from a WKT string.

QString QgsMultiPoint::geometryType() const override

Returns a unique string representing the geometry type.

bool QgsMultiPoint::insertGeometry(QgsAbstractGeometry* g, int index) override

Inserts a geometry before a specified index and takes ownership.

Parameters
g geometry to insert. Ownership is transferred to the collection.
index position to insert geometry before

Returns true in case of success.

double QgsMultiPoint::segmentLength(QgsVertexId startVertex) const override

Returns the length of the segment of the geometry which begins at startVertex.

QgsMultiPoint* QgsMultiPoint::toCurveType() const override

Returns the geometry converted to the more generic curve type.

Returns the converted geometry. Caller takes ownership

E.g. QgsLineString -> QgsCompoundCurve, QgsPolygon -> QgsCurvePolygon, QgsMultiLineString -> QgsMultiCurve, QgsMultiPolygon -> QgsMultiSurface

int QgsMultiPoint::vertexNumberFromVertexId(QgsVertexId id) const override

Returns the vertex number corresponding to a vertex id.

The vertex numbers start at 0, so a return value of 0 corresponds to the first vertex.

Returns -1 if a corresponding vertex could not be found.

bool QgsMultiPoint::wktOmitChildType() const override protected

Returns whether child type names are omitted from Wkt representations of the collection.