QgsMultiSurface class
Multi surface geometry collection.
Contents
- Reference
Base classes
- class QgsGeometryCollection
- Geometry collection.
Derived classes
- class QgsMultiPolygon
- Multi polygon 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 QgsMultiSurface*
- Cast the geom to a QgsMultiSurface.
- void clear() override
- Clears the geometry, ie reset it to a null geometry.
- auto clone() const -> QgsMultiSurface* override
- Clones the geometry by performing a deep copy.
- auto createEmptyWithSameType() const -> QgsMultiSurface* 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 toCurveType() const -> QgsMultiSurface* override
- Returns the geometry converted to the more generic curve type.
Function documentation
QDomElement QgsMultiSurface:: 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 QgsMultiSurface:: 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 QgsMultiSurface:: asJson(int precision = 17) const override
Returns a GeoJSON representation of the geometry.
| Parameters | |
|---|---|
| precision | number of decimal places for coordinates |
QgsAbstractGeometry* QgsMultiSurface:: 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 QgsMultiSurface* QgsMultiSurface:: cast(const QgsAbstractGeometry* geom) const
Cast the geom to a QgsMultiSurface.
Should be used by qgsgeometry_cast<QgsMultiSurface *>( geometry ).
QgsMultiSurface* QgsMultiSurface:: 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 QgsMultiSurface:: fromWkt(const QString& wkt) override
Sets the geometry from a WKT string.
QString QgsMultiSurface:: geometryType() const override
Returns a unique string representing the geometry type.
bool QgsMultiSurface:: 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.
QgsMultiSurface* QgsMultiSurface:: 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