mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
Expose segmentization parameters to QgsGeometry::convertToStraightSegment
This commit is contained in:
parent
871132eae6
commit
6bd7600aa3
@ -1423,10 +1423,13 @@ An empty geometry will be returned in the case of errors.
|
||||
.. versionadded:: 3.0
|
||||
%End
|
||||
|
||||
void convertToStraightSegment();
|
||||
void convertToStraightSegment( double tolerance = M_PI / 180., QgsAbstractGeometry::SegmentationToleranceType toleranceType = QgsAbstractGeometry::MaximumAngle );
|
||||
%Docstring
|
||||
Converts the geometry to straight line segments, if it is a curved geometry type.
|
||||
|
||||
:param tolerance: segmentation tolerance
|
||||
:param toleranceType: maximum segmentation angle or maximum difference between approximation and curve
|
||||
|
||||
.. versionadded:: 2.10
|
||||
|
||||
.. seealso:: :py:func:`requiresConversionToStraightSegments`
|
||||
|
@ -2312,14 +2312,14 @@ QgsGeometry QgsGeometry::polygonize( const QVector<QgsGeometry> &geometryList )
|
||||
return result;
|
||||
}
|
||||
|
||||
void QgsGeometry::convertToStraightSegment()
|
||||
void QgsGeometry::convertToStraightSegment( double tolerance, QgsAbstractGeometry::SegmentationToleranceType toleranceType )
|
||||
{
|
||||
if ( !d->geometry || !requiresConversionToStraightSegments() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
std::unique_ptr< QgsAbstractGeometry > straightGeom( d->geometry->segmentize() );
|
||||
std::unique_ptr< QgsAbstractGeometry > straightGeom( d->geometry->segmentize( tolerance, toleranceType ) );
|
||||
reset( std::move( straightGeom ) );
|
||||
}
|
||||
|
||||
|
@ -1413,10 +1413,12 @@ class CORE_EXPORT QgsGeometry
|
||||
|
||||
/**
|
||||
* Converts the geometry to straight line segments, if it is a curved geometry type.
|
||||
* \param tolerance segmentation tolerance
|
||||
* \param toleranceType maximum segmentation angle or maximum difference between approximation and curve
|
||||
* \since QGIS 2.10
|
||||
* \see requiresConversionToStraightSegments
|
||||
*/
|
||||
void convertToStraightSegment();
|
||||
void convertToStraightSegment( double tolerance = M_PI / 180., QgsAbstractGeometry::SegmentationToleranceType toleranceType = QgsAbstractGeometry::MaximumAngle );
|
||||
|
||||
/**
|
||||
* Returns true if the geometry is a curved geometry type which requires conversion to
|
||||
|
Loading…
x
Reference in New Issue
Block a user