QGIS API Documentation  3.10.0-A Coruña (6c816b4204)
Static Public Member Functions | List of all members
QgsGeometryEditUtils Class Reference

Convenience functions for geometry editing. More...

#include <qgsgeometryeditutils.h>

Static Public Member Functions

static QgsGeometry::OperationResult addPart (QgsAbstractGeometry *geometry, std::unique_ptr< QgsAbstractGeometry > part)
 Add a part to multi type geometry. More...
 
static QgsGeometry::OperationResult addRing (QgsAbstractGeometry *geometry, std::unique_ptr< QgsCurve > ring)
 Add an interior ring to a geometry. More...
 
static std::unique_ptr< QgsAbstractGeometryavoidIntersections (const QgsAbstractGeometry &geom, const QList< QgsVectorLayer *> &avoidIntersectionsLayers, const QHash< QgsVectorLayer *, QSet< QgsFeatureId > > &ignoreFeatures=(QHash< QgsVectorLayer *, QSet< QgsFeatureId > >()))
 Alters a geometry so that it avoids intersections with features from all open vector layers. More...
 
static bool deletePart (QgsAbstractGeometry *geom, int partNum)
 Deletes a part from a geometry. More...
 
static bool deleteRing (QgsAbstractGeometry *geom, int ringNum, int partNum=0)
 Deletes a ring from a geometry. More...
 

Detailed Description

Convenience functions for geometry editing.

Note
not available in Python bindings
Since
QGIS 2.10

Definition at line 38 of file qgsgeometryeditutils.h.

Member Function Documentation

◆ addPart()

QgsGeometry::OperationResult QgsGeometryEditUtils::addPart ( QgsAbstractGeometry geometry,
std::unique_ptr< QgsAbstractGeometry part 
)
static

Add a part to multi type geometry.

Ownership of the part is transferred.

Returns
0 in case of success, 1 if not a multigeometry, 2 if part is not a valid geometry, 3 if new polygon ring not disjoint with existing polygons of the feature

Definition at line 98 of file qgsgeometryeditutils.cpp.

◆ addRing()

QgsGeometry::OperationResult QgsGeometryEditUtils::addRing ( QgsAbstractGeometry geometry,
std::unique_ptr< QgsCurve ring 
)
static

Add an interior ring to a geometry.

Ownership of the ring is transferred.

Returns
0 in case of success (ring added), 1 problem with geometry type, 2 ring not closed, 3 ring is not valid geometry, 4 ring not disjoint with existing rings, 5 no polygon found which contained the ring

Definition at line 29 of file qgsgeometryeditutils.cpp.

◆ avoidIntersections()

std::unique_ptr< QgsAbstractGeometry > QgsGeometryEditUtils::avoidIntersections ( const QgsAbstractGeometry geom,
const QList< QgsVectorLayer *> &  avoidIntersectionsLayers,
const QHash< QgsVectorLayer *, QSet< QgsFeatureId > > &  ignoreFeatures = ( QHash<QgsVectorLayer *, QSet<QgsFeatureId> >() ) 
)
static

Alters a geometry so that it avoids intersections with features from all open vector layers.

Parameters
geomgeometry to alter
avoidIntersectionsLayerslist of layers to check for intersections
ignoreFeaturesmap of layer to feature id of features to ignore

Definition at line 224 of file qgsgeometryeditutils.cpp.

◆ deletePart()

bool QgsGeometryEditUtils::deletePart ( QgsAbstractGeometry geom,
int  partNum 
)
static

Deletes a part from a geometry.

Returns
true if delete was successful

Definition at line 208 of file qgsgeometryeditutils.cpp.

◆ deleteRing()

bool QgsGeometryEditUtils::deleteRing ( QgsAbstractGeometry geom,
int  ringNum,
int  partNum = 0 
)
static

Deletes a ring from a geometry.

Returns
true if delete was successful

Definition at line 175 of file qgsgeometryeditutils.cpp.


The documentation for this class was generated from the following files: