QGIS API Documentation  2.18.3-Las Palmas (77b8c3d)
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 int addPart (QgsAbstractGeometryV2 *geom, QgsAbstractGeometryV2 *part)
 Adds part to multi type geometry (taking ownership) More...
 
static int addRing (QgsAbstractGeometryV2 *geom, QgsCurveV2 *ring)
 Adds interior ring (taking ownership). More...
 
static QgsAbstractGeometryV2avoidIntersections (const QgsAbstractGeometryV2 &geom, QMap< QgsVectorLayer *, QSet< QgsFeatureId > > ignoreFeatures=(QMap< QgsVectorLayer *, QSet< QgsFeatureId > >()))
 Alters a geometry so that it avoids intersections with features from all open vector layers. More...
 
static bool deletePart (QgsAbstractGeometryV2 *geom, int partNum)
 Deletes a part from a geometry. More...
 
static bool deleteRing (QgsAbstractGeometryV2 *geom, int ringNum, int partNum=0)
 Deletes a ring from a geometry. More...
 

Detailed Description

Convenience functions for geometry editing.

Note
added in QGIS 2.10
this API is not considered stable and may change for 2.12
not available in Python bindings

Definition at line 34 of file qgsgeometryeditutils.h.

Member Function Documentation

int QgsGeometryEditUtils::addPart ( QgsAbstractGeometryV2 geom,
QgsAbstractGeometryV2 part 
)
static

Adds part to multi type geometry (taking ownership)

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 103 of file qgsgeometryeditutils.cpp.

int QgsGeometryEditUtils::addRing ( QgsAbstractGeometryV2 geom,
QgsCurveV2 ring 
)
static

Adds interior ring (taking ownership).

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.

QgsAbstractGeometryV2 * QgsGeometryEditUtils::avoidIntersections ( const QgsAbstractGeometryV2 geom,
QMap< QgsVectorLayer *, QSet< QgsFeatureId > >  ignoreFeatures = QMap<QgsVectorLayer*, QSet<QgsFeatureId> >() ) 
)
static

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

Parameters
geomgeometry to alter
ignoreFeaturesmap of layer to feature id of features to ignore

Definition at line 227 of file qgsgeometryeditutils.cpp.

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

Deletes a part from a geometry.

Returns
true if delete was successful

Definition at line 211 of file qgsgeometryeditutils.cpp.

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

Deletes a ring from a geometry.

Returns
true if delete was successful

Definition at line 178 of file qgsgeometryeditutils.cpp.


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