QGIS API Documentation
3.20.0-Odense (decaadbb31)
|
#include <qgsvectorlayereditutils.h>
Public Member Functions | |
QgsVectorLayerEditUtils (QgsVectorLayer *layer) | |
QgsGeometry::OperationResult | addPart (const QgsPointSequence &ring, QgsFeatureId featureId) |
Adds a new part polygon to a multipart feature. More... | |
Q_DECL_DEPRECATED QgsGeometry::OperationResult | addPart (const QVector< QgsPointXY > &ring, QgsFeatureId featureId) |
Adds a new part polygon to a multipart feature. More... | |
QgsGeometry::OperationResult | addPart (QgsCurve *ring, QgsFeatureId featureId) |
Adds a new part polygon to a multipart feature. More... | |
QgsGeometry::OperationResult | addRing (const QgsPointSequence &ring, const QgsFeatureIds &targetFeatureIds=QgsFeatureIds(), QgsFeatureId *modifiedFeatureId=nullptr) |
Adds a ring to polygon/multipolygon features. More... | |
Q_DECL_DEPRECATED QgsGeometry::OperationResult | addRing (const QVector< QgsPointXY > &ring, const QgsFeatureIds &targetFeatureIds=QgsFeatureIds(), QgsFeatureId *modifiedFeatureId=nullptr) |
Adds a ring to polygon/multipolygon features. More... | |
QgsGeometry::OperationResult | addRing (QgsCurve *ring, const QgsFeatureIds &targetFeatureIds=QgsFeatureIds(), QgsFeatureId *modifiedFeatureId=nullptr) |
Adds a ring to polygon/multipolygon features. More... | |
int | addTopologicalPoints (const QgsGeometry &geom) |
Adds topological points for every vertex of the geometry. More... | |
int | addTopologicalPoints (const QgsPoint &p) |
Adds a vertex to segments which intersect point p but don't already have a vertex there. More... | |
int | addTopologicalPoints (const QgsPointSequence &ps) |
Adds a vertex to segments which intersect point p but don't already have a vertex there. More... | |
int | addTopologicalPoints (const QgsPointXY &p) |
Adds a vertex to segments which intersect point p but don't already have a vertex there. More... | |
QgsVectorLayer::EditResult | deleteVertex (QgsFeatureId featureId, int vertex) |
Deletes a vertex from a feature. More... | |
bool | insertVertex (const QgsPoint &point, QgsFeatureId atFeatureId, int beforeVertex) |
Inserts a new vertex before the given vertex number, in the given ring, item (first number is index 0), and feature Not meaningful for Point geometries. More... | |
bool | insertVertex (double x, double y, QgsFeatureId atFeatureId, int beforeVertex) |
Insert a new vertex before the given vertex number, in the given ring, item (first number is index 0), and feature Not meaningful for Point geometries. More... | |
bool | moveVertex (const QgsPoint &p, QgsFeatureId atFeatureId, int atVertex) |
Moves the vertex at the given position number, ring and item (first number is index 0), and feature to the given coordinates. More... | |
bool | moveVertex (double x, double y, QgsFeatureId atFeatureId, int atVertex) |
Moves the vertex at the given position number, ring and item (first number is index 0), and feature to the given coordinates. More... | |
QgsGeometry::OperationResult | splitFeatures (const QgsCurve *curve, QgsPointSequence &topologyTestPoints, bool preserveCircular=false, bool topologicalEditing=false) |
Splits features cut by the given curve. More... | |
QgsGeometry::OperationResult | splitFeatures (const QgsPointSequence &splitLine, bool topologicalEditing=false) |
Splits features cut by the given line. More... | |
Q_DECL_DEPRECATED QgsGeometry::OperationResult | splitFeatures (const QVector< QgsPointXY > &splitLine, bool topologicalEditing=false) |
Splits features cut by the given line. More... | |
QgsGeometry::OperationResult | splitParts (const QgsPointSequence &splitLine, bool topologicalEditing=false) |
Splits parts cut by the given line. More... | |
Q_DECL_DEPRECATED QgsGeometry::OperationResult | splitParts (const QVector< QgsPointXY > &splitLine, bool topologicalEditing=false) |
Splits parts cut by the given line. More... | |
int | translateFeature (QgsFeatureId featureId, double dx, double dy) |
Translates feature by dx, dy. More... | |
Definition at line 31 of file qgsvectorlayereditutils.h.
QgsVectorLayerEditUtils::QgsVectorLayerEditUtils | ( | QgsVectorLayer * | layer | ) |
Definition at line 34 of file qgsvectorlayereditutils.cpp.
QgsGeometry::OperationResult QgsVectorLayerEditUtils::addPart | ( | const QgsPointSequence & | ring, |
QgsFeatureId | featureId | ||
) |
Adds a new part polygon to a multipart feature.
Definition at line 197 of file qgsvectorlayereditutils.cpp.
QgsGeometry::OperationResult QgsVectorLayerEditUtils::addPart | ( | const QVector< QgsPointXY > & | ring, |
QgsFeatureId | featureId | ||
) |
Adds a new part polygon to a multipart feature.
QgsGeometry::InvalidInput
Definition at line 187 of file qgsvectorlayereditutils.cpp.
QgsGeometry::OperationResult QgsVectorLayerEditUtils::addPart | ( | QgsCurve * | ring, |
QgsFeatureId | featureId | ||
) |
Adds a new part polygon to a multipart feature.
Definition at line 232 of file qgsvectorlayereditutils.cpp.
QgsGeometry::OperationResult QgsVectorLayerEditUtils::addRing | ( | const QgsPointSequence & | ring, |
const QgsFeatureIds & | targetFeatureIds = QgsFeatureIds() , |
||
QgsFeatureId * | modifiedFeatureId = nullptr |
||
) |
Adds a ring to polygon/multipolygon features.
ring | ring to add |
targetFeatureIds | if specified, only these features will be the candidates for adding a ring. Otherwise all intersecting features are tested and the ring is added to the first valid feature. |
modifiedFeatureId | if specified, feature ID for feature that ring was added to will be stored in this parameter |
Definition at line 131 of file qgsvectorlayereditutils.cpp.
QgsGeometry::OperationResult QgsVectorLayerEditUtils::addRing | ( | const QVector< QgsPointXY > & | ring, |
const QgsFeatureIds & | targetFeatureIds = QgsFeatureIds() , |
||
QgsFeatureId * | modifiedFeatureId = nullptr |
||
) |
Adds a ring to polygon/multipolygon features.
ring | ring to add |
targetFeatureIds | if specified, only these features will be the candidates for adding a ring. Otherwise all intersecting features are tested and the ring is added to the first valid feature. |
modifiedFeatureId | if specified, feature ID for feature that ring was added to will be stored in this parameter |
Definition at line 121 of file qgsvectorlayereditutils.cpp.
QgsGeometry::OperationResult QgsVectorLayerEditUtils::addRing | ( | QgsCurve * | ring, |
const QgsFeatureIds & | targetFeatureIds = QgsFeatureIds() , |
||
QgsFeatureId * | modifiedFeatureId = nullptr |
||
) |
Adds a ring to polygon/multipolygon features.
ring | ring to add |
targetFeatureIds | if specified, only these features will be the candidates for adding a ring. Otherwise all intersecting features are tested and the ring is added to the first valid feature. |
modifiedFeatureId | if specified, feature ID for feature that ring was added to will be stored in this parameter |
Definition at line 137 of file qgsvectorlayereditutils.cpp.
int QgsVectorLayerEditUtils::addTopologicalPoints | ( | const QgsGeometry & | geom | ) |
Adds topological points for every vertex of the geometry.
geom | the geometry where each vertex is added to segments of other features |
Definition at line 536 of file qgsvectorlayereditutils.cpp.
int QgsVectorLayerEditUtils::addTopologicalPoints | ( | const QgsPoint & | p | ) |
Adds a vertex to segments which intersect point p but don't already have a vertex there.
If a feature already has a vertex at position p, no additional vertex is inserted. This method is useful for topological editing.
Definition at line 561 of file qgsvectorlayereditutils.cpp.
int QgsVectorLayerEditUtils::addTopologicalPoints | ( | const QgsPointSequence & | ps | ) |
Adds a vertex to segments which intersect point p but don't already have a vertex there.
If a feature already has a vertex at position p, no additional vertex is inserted. This method is useful for topological editing.
Definition at line 640 of file qgsvectorlayereditutils.cpp.
int QgsVectorLayerEditUtils::addTopologicalPoints | ( | const QgsPointXY & | p | ) |
Adds a vertex to segments which intersect point p but don't already have a vertex there.
If a feature already has a vertex at position p, no additional vertex is inserted. This method is useful for topological editing.
Definition at line 665 of file qgsvectorlayereditutils.cpp.
QgsVectorLayer::EditResult QgsVectorLayerEditUtils::deleteVertex | ( | QgsFeatureId | featureId, |
int | vertex | ||
) |
Deletes a vertex from a feature.
featureId | ID of feature to remove vertex from |
vertex | index of vertex to delete |
Definition at line 97 of file qgsvectorlayereditutils.cpp.
bool QgsVectorLayerEditUtils::insertVertex | ( | const QgsPoint & | point, |
QgsFeatureId | atFeatureId, | ||
int | beforeVertex | ||
) |
Inserts a new vertex before the given vertex number, in the given ring, item (first number is index 0), and feature Not meaningful for Point geometries.
Definition at line 56 of file qgsvectorlayereditutils.cpp.
bool QgsVectorLayerEditUtils::insertVertex | ( | double | x, |
double | y, | ||
QgsFeatureId | atFeatureId, | ||
int | beforeVertex | ||
) |
Insert a new vertex before the given vertex number, in the given ring, item (first number is index 0), and feature Not meaningful for Point geometries.
Definition at line 39 of file qgsvectorlayereditutils.cpp.
bool QgsVectorLayerEditUtils::moveVertex | ( | const QgsPoint & | p, |
QgsFeatureId | atFeatureId, | ||
int | atVertex | ||
) |
Moves the vertex at the given position number, ring and item (first number is index 0), and feature to the given coordinates.
Definition at line 79 of file qgsvectorlayereditutils.cpp.
bool QgsVectorLayerEditUtils::moveVertex | ( | double | x, |
double | y, | ||
QgsFeatureId | atFeatureId, | ||
int | atVertex | ||
) |
Moves the vertex at the given position number, ring and item (first number is index 0), and feature to the given coordinates.
Definition at line 73 of file qgsvectorlayereditutils.cpp.
QgsGeometry::OperationResult QgsVectorLayerEditUtils::splitFeatures | ( | const QgsCurve * | curve, |
QgsPointSequence & | topologyTestPoints, | ||
bool | preserveCircular = false , |
||
bool | topologicalEditing = false |
||
) |
Splits features cut by the given curve.
curve | line that splits the layer features | |
[out] | topologyTestPoints | topological points to be tested against other layers |
preserveCircular | whether circular strings are preserved after splitting | |
topologicalEditing | true if topological editing is enabled |
Definition at line 305 of file qgsvectorlayereditutils.cpp.
QgsGeometry::OperationResult QgsVectorLayerEditUtils::splitFeatures | ( | const QgsPointSequence & | splitLine, |
bool | topologicalEditing = false |
||
) |
Splits features cut by the given line.
splitLine | line that splits the layer features |
topologicalEditing | true if topological editing is enabled |
Definition at line 297 of file qgsvectorlayereditutils.cpp.
QgsGeometry::OperationResult QgsVectorLayerEditUtils::splitFeatures | ( | const QVector< QgsPointXY > & | splitLine, |
bool | topologicalEditing = false |
||
) |
Splits features cut by the given line.
splitLine | line that splits the layer features |
topologicalEditing | true if topological editing is enabled |
Definition at line 287 of file qgsvectorlayereditutils.cpp.
QgsGeometry::OperationResult QgsVectorLayerEditUtils::splitParts | ( | const QgsPointSequence & | splitLine, |
bool | topologicalEditing = false |
||
) |
Splits parts cut by the given line.
splitLine | line that splits the layer feature parts |
topologicalEditing | true if topological editing is enabled |
Definition at line 427 of file qgsvectorlayereditutils.cpp.
QgsGeometry::OperationResult QgsVectorLayerEditUtils::splitParts | ( | const QVector< QgsPointXY > & | splitLine, |
bool | topologicalEditing = false |
||
) |
Splits parts cut by the given line.
splitLine | line that splits the layer feature parts |
topologicalEditing | true if topological editing is enabled |
QgsGeometry::SplitCannotSplitPoint
Definition at line 417 of file qgsvectorlayereditutils.cpp.
int QgsVectorLayerEditUtils::translateFeature | ( | QgsFeatureId | featureId, |
double | dx, | ||
double | dy | ||
) |
Translates feature by dx, dy.
featureId | id of the feature to translate |
dx | translation of x-coordinate |
dy | translation of y-coordinate |
Definition at line 268 of file qgsvectorlayereditutils.cpp.