File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -1423,10 +1423,13 @@ An empty geometry will be returned in the case of errors.
1423
1423
.. versionadded:: 3.0
1424
1424
%End
1425
1425
1426
- void convertToStraightSegment();
1426
+ void convertToStraightSegment( double tolerance = M_PI / 180., QgsAbstractGeometry::SegmentationToleranceType toleranceType = QgsAbstractGeometry::MaximumAngle );
1427
1427
%Docstring
1428
1428
Converts the geometry to straight line segments, if it is a curved geometry type.
1429
1429
1430
+ :param tolerance: segmentation tolerance
1431
+ :param toleranceType: maximum segmentation angle or maximum difference between approximation and curve
1432
+
1430
1433
.. versionadded:: 2.10
1431
1434
1432
1435
.. seealso:: :py:func:`requiresConversionToStraightSegments`
Original file line number Diff line number Diff line change @@ -2312,14 +2312,14 @@ QgsGeometry QgsGeometry::polygonize( const QVector<QgsGeometry> &geometryList )
2312
2312
return result;
2313
2313
}
2314
2314
2315
- void QgsGeometry::convertToStraightSegment ()
2315
+ void QgsGeometry::convertToStraightSegment ( double tolerance, QgsAbstractGeometry::SegmentationToleranceType toleranceType )
2316
2316
{
2317
2317
if ( !d->geometry || !requiresConversionToStraightSegments () )
2318
2318
{
2319
2319
return ;
2320
2320
}
2321
2321
2322
- std::unique_ptr< QgsAbstractGeometry > straightGeom ( d->geometry ->segmentize () );
2322
+ std::unique_ptr< QgsAbstractGeometry > straightGeom ( d->geometry ->segmentize ( tolerance, toleranceType ) );
2323
2323
reset ( std::move ( straightGeom ) );
2324
2324
}
2325
2325
Original file line number Diff line number Diff line change @@ -1413,10 +1413,12 @@ class CORE_EXPORT QgsGeometry
1413
1413
1414
1414
/* *
1415
1415
* Converts the geometry to straight line segments, if it is a curved geometry type.
1416
+ * \param tolerance segmentation tolerance
1417
+ * \param toleranceType maximum segmentation angle or maximum difference between approximation and curve
1416
1418
* \since QGIS 2.10
1417
1419
* \see requiresConversionToStraightSegments
1418
1420
*/
1419
- void convertToStraightSegment ();
1421
+ void convertToStraightSegment ( double tolerance = M_PI / 180 ., QgsAbstractGeometry::SegmentationToleranceType toleranceType = QgsAbstractGeometry::MaximumAngle );
1420
1422
1421
1423
/* *
1422
1424
* Returns true if the geometry is a curved geometry type which requires conversion to
You can’t perform that action at this time.
0 commit comments