QgsMultiCurve class

Multi curve geometry collection.

Base classes

class QgsGeometryCollection
Geometry collection.

Derived classes

class QgsMultiLineString
Multi line string 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 QgsMultiCurve*
Cast the geom to a QgsMultiCurve.
void clear() override
Clears the geometry, ie reset it to a null geometry.
auto clone() const -> QgsMultiCurve* override
Clones the geometry by performing a deep copy.
auto createEmptyWithSameType() const -> QgsMultiCurve* override
Creates a new geometry with the same class and same WKB type as the original and transfers ownership.
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 reversed() const -> QgsMultiCurve*
Returns a copy of the multi curve, where each component curve has had its line direction reversed.
auto toCurveType() const -> QgsMultiCurve* override
Returns the geometry converted to the more generic curve type.

Function documentation

QDomElement QgsMultiCurve::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 QgsMultiCurve::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 QgsMultiCurve::asJson(int precision = 17) const override

Returns a GeoJSON representation of the geometry.

Parameters
precision number of decimal places for coordinates

QgsAbstractGeometry* QgsMultiCurve::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 QgsMultiCurve* QgsMultiCurve::cast(const QgsAbstractGeometry* geom) const

Cast the geom to a QgsMultiCurve.

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

QgsMultiCurve* QgsMultiCurve::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.

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

Sets the geometry from a WKT string.

QString QgsMultiCurve::geometryType() const override

Returns a unique string representing the geometry type.

bool QgsMultiCurve::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.

QgsMultiCurve* QgsMultiCurve::reversed() const

Returns a copy of the multi curve, where each component curve has had its line direction reversed.

QgsMultiCurve* QgsMultiCurve::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