diff --git a/python/core/auto_generated/geometry/qgsgeometry.sip.in b/python/core/auto_generated/geometry/qgsgeometry.sip.in index 1d9ac9f3ccb..eaeaa0542be 100644 --- a/python/core/auto_generated/geometry/qgsgeometry.sip.in +++ b/python/core/auto_generated/geometry/qgsgeometry.sip.in @@ -1229,6 +1229,21 @@ Curved geometry types are automatically segmentized by this routine. .. seealso:: :py:func:`densifyByCount` .. versionadded:: 3.0 +%End + + QgsGeometry convertToCurves( double distanceTolerance = 1e-8, double angleTolerance = 1e-8 ) const; +%Docstring +Attempts to convert a non-curved geometry into a curved geometry type (e.g. +LineString to CompoundCurve, Polygon to CurvePolygon). + +The ``distanceTolerance`` specifies the maximum deviation allowed between the original location +of vertices and where they would fall on the candidate curved geometry. + +This method only consider a segments as suitable for replacing with an arc if the points are all +regularly spaced on the candidate arc. The ``pointSpacingAngleTolerance`` parameter specifies the maximum +angular deviation (in radians) allowed when testing for regular point spacing. + +.. versionadded:: 3.14 %End QgsGeometry centroid() const; diff --git a/python/core/auto_generated/geometry/qgsgeometryutils.sip.in b/python/core/auto_generated/geometry/qgsgeometryutils.sip.in index 9ee9a139f30..fcf1c81cfd1 100644 --- a/python/core/auto_generated/geometry/qgsgeometryutils.sip.in +++ b/python/core/auto_generated/geometry/qgsgeometryutils.sip.in @@ -242,7 +242,7 @@ Project the point on a segment static int leftOfLine( const double x, const double y, const double x1, const double y1, const double x2, const double y2 ); %Docstring -Returns a value < 0 if the point (``x``, ``y``) is left of the line from (``x1``, ``y1``) -> ( ``x2``, ``y2``). +Returns a value < 0 if the point (``x``, ``y``) is left of the line from (``x1``, ``y1``) -> (``x2``, ``y2``). A positive return value indicates the point is to the right of the line. If the return value is 0, then the test was unsuccessful (e.g. due to testing a point exactly @@ -352,6 +352,22 @@ Calculates the direction angle of a circle tangent (clockwise from north in radi Convert circular arc defined by p1, p2, p3 (p1/p3 being start resp. end point, p2 lies on the arc) into a sequence of points. .. versionadded:: 3.0 +%End + + static bool pointContinuesArc( const QgsPoint &a1, const QgsPoint &a2, const QgsPoint &a3, const QgsPoint &b, double distanceTolerance, + double pointSpacingAngleTolerance ); +%Docstring +Returns true if point ``b`` is on the arc formed by points ``a1``, ``a2``, and ``a3``, but not within +that arc portion already described by ``a1``, ``a2`` and ``a3``. + +The ``distanceTolerance`` specifies the maximum deviation allowed between the original location +of point \b and where it would fall on the candidate arc. + +This method only consider a segments as continuing an arc if the points are all regularly spaced +on the candidate arc. The ``pointSpacingAngleTolerance`` parameter specifies the maximum +angular deviation (in radians) allowed when testing for regular point spacing. + +.. versionadded:: 3.14 %End static int segmentSide( const QgsPoint &pt1, const QgsPoint &pt3, const QgsPoint &pt2 ); diff --git a/src/analysis/processing/qgsalgorithmconverttocurves.h b/src/analysis/processing/qgsalgorithmconverttocurves.h index 972ee69afbd..f373ac3d3c0 100644 --- a/src/analysis/processing/qgsalgorithmconverttocurves.h +++ b/src/analysis/processing/qgsalgorithmconverttocurves.h @@ -15,8 +15,8 @@ * * ***************************************************************************/ -#ifndef QGSALGORITHMSEGMENTIZE_H -#define QGSALGORITHMSEGMENTIZE_H +#ifndef QGSALGORITHMCONVERTTOCURVES_H +#define QGSALGORITHMCONVERTTOCURVES_H #define SIP_NO_FILE @@ -65,6 +65,6 @@ class QgsConvertToCurvesAlgorithm : public QgsProcessingFeatureBasedAlgorithm ///@endcond PRIVATE -#endif // QGSALGORITHMSEGMENTIZE_H +#endif // QGSALGORITHMCONVERTTOCURVES_H diff --git a/src/core/geometry/qgsgeometry.h b/src/core/geometry/qgsgeometry.h index 1d1226b9671..5ce7c4b82b1 100644 --- a/src/core/geometry/qgsgeometry.h +++ b/src/core/geometry/qgsgeometry.h @@ -1254,7 +1254,7 @@ class CORE_EXPORT QgsGeometry * regularly spaced on the candidate arc. The \a pointSpacingAngleTolerance parameter specifies the maximum * angular deviation (in radians) allowed when testing for regular point spacing. * - * \since QGIS 3.2 + * \since QGIS 3.14 */ QgsGeometry convertToCurves( double distanceTolerance = 1e-8, double angleTolerance = 1e-8 ) const; diff --git a/src/core/geometry/qgsgeometryutils.h b/src/core/geometry/qgsgeometryutils.h index 6f164b4edde..899c3d74986 100644 --- a/src/core/geometry/qgsgeometryutils.h +++ b/src/core/geometry/qgsgeometryutils.h @@ -383,7 +383,7 @@ class CORE_EXPORT QgsGeometryUtils * on the candidate arc. The \a pointSpacingAngleTolerance parameter specifies the maximum * angular deviation (in radians) allowed when testing for regular point spacing. * - * \since QGIS 3.2 + * \since QGIS 3.14 */ static bool pointContinuesArc( const QgsPoint &a1, const QgsPoint &a2, const QgsPoint &a3, const QgsPoint &b, double distanceTolerance, double pointSpacingAngleTolerance ); diff --git a/src/core/geometry/qgsinternalgeometryengine.h b/src/core/geometry/qgsinternalgeometryengine.h index 1e9528249aa..00c3bdf7d9d 100644 --- a/src/core/geometry/qgsinternalgeometryengine.h +++ b/src/core/geometry/qgsinternalgeometryengine.h @@ -177,7 +177,7 @@ class QgsInternalGeometryEngine * regularly spaced on the candidate arc. The \a pointSpacingAngleTolerance parameter specifies the maximum * angular deviation (in radians) allowed when testing for regular point spacing. * - * \since QGIS 3.2 + * \since QGIS 3.14 */ QgsGeometry convertToCurves( double distanceTolerance, double angleTolerance ) const;