1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/vector/qgsvectorlayereditutils.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsVectorLayerEditUtils
{
%Docstring(signature="appended")
Contains utility functions for editing vector layers.
%End
%TypeHeaderCode
#include "qgsvectorlayereditutils.h"
%End
public:
QgsVectorLayerEditUtils( QgsVectorLayer *layer );
bool insertVertex( double x, double y, QgsFeatureId atFeatureId, int beforeVertex );
%Docstring
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
%End
bool insertVertex( const QgsPoint &point, QgsFeatureId atFeatureId, int beforeVertex );
%Docstring
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
%End
bool moveVertex( double x, double y, QgsFeatureId atFeatureId, int atVertex );
%Docstring
Moves the vertex at the given position number, ring and item (first
number is index 0), and feature to the given coordinates
%End
bool moveVertex( const QgsPoint &p, QgsFeatureId atFeatureId, int atVertex ) /PyName=moveVertexV2/;
%Docstring
Moves the vertex at the given position number, ring and item (first
number is index 0), and feature to the given coordinates
%End
Qgis::VectorEditResult deleteVertex( QgsFeatureId featureId, int vertex );
%Docstring
Deletes a vertex from a feature.
:param featureId: ID of feature to remove vertex from
:param vertex: index of vertex to delete
%End
Qgis::GeometryOperationResult addRing( const QVector<QgsPointXY> &ring, const QgsFeatureIds &targetFeatureIds = QgsFeatureIds(), QgsFeatureId *modifiedFeatureId = 0 ) /Deprecated/;
%Docstring
Adds a ring to polygon/multipolygon features
:param ring: ring to add
:param 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.
:param modifiedFeatureId: if specified, feature ID for feature that ring
was added to will be stored in this parameter
:return: OperationResult result code: success or reason of failure
.. deprecated:: 3.12
Will be removed in QGIS 4.0. Use the variant which accepts :py:class:`QgsPoint` objects instead of :py:class:`QgsPointXY`.
%End
Qgis::GeometryOperationResult addRing( const QgsPointSequence &ring, const QgsFeatureIds &targetFeatureIds = QgsFeatureIds(), QgsFeatureId *modifiedFeatureId = 0 );
%Docstring
Adds a ring to polygon/multipolygon features
:param ring: ring to add
:param 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.
:param modifiedFeatureId: if specified, feature ID for feature that ring
was added to will be stored in this parameter
:return: OperationResult result code: success or reason of failure
%End
Qgis::GeometryOperationResult addRingV2( QgsCurve *ring /Transfer/, const QgsFeatureIds &targetFeatureIds = QgsFeatureIds(), QgsFeatureIds *modifiedFeatureIds /Out/ = 0 );
%Docstring
Adds a ring to polygon/multipolygon features
:param ring: ring to add (ownership is transferred)
:param 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 all valid features.
:return: - OperationResult result code: success or reason of failure
- modifiedFeatureIds: feature IDS for features that ring was
added to will be stored in this parameter
.. versionadded:: 3.28
%End
Qgis::GeometryOperationResult addRing( QgsCurve *ring /Transfer/, const QgsFeatureIds &targetFeatureIds = QgsFeatureIds(), QgsFeatureId *modifiedFeatureId = 0 ) /PyName=addCurvedRing/;
%Docstring
Adds a ring to polygon/multipolygon features
:param ring: ring to add
:param 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.
:param modifiedFeatureId: if specified, feature ID for feature that ring
was added to will be stored in this parameter
:return: OperationResult result code: success or reason of failure
%End
Qgis::GeometryOperationResult addPart( const QVector<QgsPointXY> &ring, QgsFeatureId featureId ) /Deprecated/;
%Docstring
Adds a new part polygon to a multipart feature
:return: - :py:class:`QgsGeometry`.Success
- :py:class:`QgsGeometry`.AddPartSelectedGeometryNotFound
- :py:class:`QgsGeometry`.AddPartNotMultiGeometry
- :py:class:`QgsGeometry`.InvalidBaseGeometry
- :py:class:`QgsGeometry`.InvalidInput
.. deprecated:: 3.12
Will be removed in QGIS 4.0. Use the variant which accepts :py:class:`QgsPoint` objects instead of :py:class:`QgsPointXY`.
%End
Qgis::GeometryOperationResult addPart( const QgsPointSequence &ring, QgsFeatureId featureId );
%Docstring
Adds a new part polygon to a multipart feature
:return: - :py:class:`QgsGeometry`.Success
- :py:class:`QgsGeometry`.AddPartSelectedGeometryNotFound
- :py:class:`QgsGeometry`.AddPartNotMultiGeometry
- :py:class:`QgsGeometry`.InvalidBaseGeometry
- :py:class:`QgsGeometry`.InvalidInput
.. note::
available in python bindings as addPartV2
%End
Qgis::GeometryOperationResult addPart( QgsCurve *ring /Transfer/, QgsFeatureId featureId ) /PyName=addCurvedPart/;
%Docstring
Adds a new part polygon to a multipart feature
:return: - :py:class:`QgsGeometry`.Success
- :py:class:`QgsGeometry`.AddPartSelectedGeometryNotFound
- :py:class:`QgsGeometry`.AddPartNotMultiGeometry
- :py:class:`QgsGeometry`.InvalidBaseGeometry
- :py:class:`QgsGeometry`.InvalidInput
%End
int translateFeature( QgsFeatureId featureId, double dx, double dy );
%Docstring
Translates feature by dx, dy
:param featureId: id of the feature to translate
:param dx: translation of x-coordinate
:param dy: translation of y-coordinate
:return: 0 in case of success
%End
Qgis::GeometryOperationResult splitParts( const QVector<QgsPointXY> &splitLine, bool topologicalEditing = false ) /Deprecated/;
%Docstring
Splits parts cut by the given line
:param splitLine: line that splits the layer feature parts
:param topologicalEditing: ``True`` if topological editing is enabled
:return: - :py:class:`QgsGeometry`.InvalidBaseGeometry
- :py:class:`QgsGeometry`.Success
- :py:class:`QgsGeometry`.InvalidInput
- :py:class:`QgsGeometry`.NothingHappened if a selection is present but no feature has been split
- :py:class:`QgsGeometry`.InvalidBaseGeometry
- :py:class:`QgsGeometry`.GeometryEngineError
- :py:class:`QgsGeometry`.SplitCannotSplitPoint
.. deprecated:: 3.12
Will be removed in QGIS 4.0. Use the variant which accepts :py:class:`QgsPoint` objects instead of :py:class:`QgsPointXY`.
%End
Qgis::GeometryOperationResult splitParts( const QgsPointSequence &splitLine, bool topologicalEditing = false );
%Docstring
Splits parts cut by the given line
:param splitLine: line that splits the layer feature parts
:param topologicalEditing: ``True`` if topological editing is enabled
:return: - :py:class:`QgsGeometry`.InvalidBaseGeometry
- :py:class:`QgsGeometry`.Success
- :py:class:`QgsGeometry`.InvalidInput
- :py:class:`QgsGeometry`.NothingHappened if a selection is present but no feature has been split
- :py:class:`QgsGeometry`.InvalidBaseGeometry
- :py:class:`QgsGeometry`.GeometryEngineError
- :py:class:`QgsGeometry`.SplitCannotSplitPoint
%End
Qgis::GeometryOperationResult splitFeatures( const QVector<QgsPointXY> &splitLine, bool topologicalEditing = false ) /Deprecated/;
%Docstring
Splits features cut by the given line
:param splitLine: line that splits the layer features
:param topologicalEditing: ``True`` if topological editing is enabled
:return: :py:class:`QgsGeometry`.OperationResult
.. deprecated:: 3.12
Will be removed in QGIS 4.0. Use the variant which accepts :py:class:`QgsPoint` objects instead of :py:class:`QgsPointXY`.
%End
Qgis::GeometryOperationResult splitFeatures( const QgsPointSequence &splitLine, bool topologicalEditing = false );
%Docstring
Splits features cut by the given line
:param splitLine: line that splits the layer features
:param topologicalEditing: ``True`` if topological editing is enabled
:return: :py:class:`QgsGeometry`.OperationResult
%End
Qgis::GeometryOperationResult splitFeatures( const QgsCurve *curve, QgsPointSequence &topologyTestPoints /Out/, bool preserveCircular = false, bool topologicalEditing = false );
%Docstring
Splits features cut by the given curve
:param curve: line that splits the layer features
:param preserveCircular: whether circular strings are preserved after
splitting
:param topologicalEditing: ``True`` if topological editing is enabled
:return: - :py:class:`QgsGeometry`.OperationResult
- topologyTestPoints: topological points to be tested against
other layers
.. versionadded:: 3.16
%End
int addTopologicalPoints( const QgsGeometry &geom );
%Docstring
Adds topological points for every vertex of the geometry.
:param geom: the geometry where each vertex is added to segments of
other features
:return: 0 in case of success
:return: 1 in case of error
:return: 2 in case no vertices needed to be added
.. note::
geom is not going to be modified by the function
%End
int addTopologicalPoints( const QgsPointXY &p );
%Docstring
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.
:return: 0 in case of success
:return: 1 in case of error
:return: 2 in case no vertices needed to be added
%End
int addTopologicalPoints( const QgsPoint &p );
%Docstring
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.
:return: 0 in case of success
:return: 1 in case of error
:return: 2 in case no vertices needed to be added
.. versionadded:: 3.10
%End
int addTopologicalPoints( const QgsPointSequence &ps );
%Docstring
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.
:return: 0 in case of success
:return: 1 in case of error
:return: 2 in case vertex already exists or point does not intersect
segment
.. versionadded:: 3.16
%End
bool mergeFeatures( const QgsFeatureId &targetFeatureId, const QgsFeatureIds &mergeFeatureIds, const QgsAttributes &mergeAttributes, const QgsGeometry &unionGeometry, QString &errorMessage /Out/ );
%Docstring
Merge features into a single one.
:param targetFeatureId: id of the target feature (will be updated)
:param mergeFeatureIds: id list of features to merge (will be deleted)
:param mergeAttributes: are the resulting attributes in the merged
feature
:param unionGeometry: is the resulting geometry of the merged feature
:return: - ``True`` if the merge was successful, or ``False`` if the
operation failed.
- errorMessage: a descriptive error message if any occurs
.. versionadded:: 3.30
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/vector/qgsvectorlayereditutils.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|