@@ -501,7 +501,7 @@ Returns true if WKB of the geometry is of WKBMulti* type
501501 \param afterVertex Receives index of the vertex after the closest segment. The vertex
502502 before the closest segment is always afterVertex - 1
503503 \param leftOf Out: Returns if the point lies on the left of left side of the geometry ( < 0 means left, > 0 means right, 0 indicates
504- that the test was unsuccesful , e.g. for a point exactly on the line)
504+ that the test was unsuccessful , e.g. for a point exactly on the line)
505505 \param epsilon epsilon for segment snapping
506506 :return: The squared Cartesian distance is also returned in sqrDist, negative number on error
507507 :rtype: float
@@ -688,6 +688,29 @@ Returns true if WKB of the geometry is of WKBMulti* type
688688 :rtype: QgsGeometry
689689%End
690690
691+ bool removeDuplicateNodes( double epsilon = 4 * DBL_EPSILON, bool useZValues = false );
692+ %Docstring
693+ Removes duplicate nodes from the geometry, wherever removing the nodes does not result in a
694+ degenerate geometry.
695+
696+ The ``epsilon`` parameter specifies the tolerance for coordinates when determining that
697+ vertices are identical.
698+
699+ By default, z values are not considered when detecting duplicate nodes. E.g. two nodes
700+ with the same x and y coordinate but different z values will still be considered
701+ duplicate and one will be removed. If ``useZValues`` is true, then the z values are
702+ also tested and nodes with the same x and y but different z will be maintained.
703+
704+ Note that duplicate nodes are not tested between different parts of a multipart geometry. E.g.
705+ a multipoint geometry with overlapping points will not be changed by this method.
706+
707+ The function will return true if nodes were removed, or false if no duplicate nodes
708+ were found.
709+
710+ .. versionadded:: 3.0
711+ :rtype: bool
712+ %End
713+
691714 bool intersects( const QgsRectangle &r ) const;
692715%Docstring
693716Tests for intersection with a rectangle (uses GEOS)
0 commit comments