diff --git a/src/core/vector/qgsvectorlayerprofilegenerator.cpp b/src/core/vector/qgsvectorlayerprofilegenerator.cpp index a77d368089bf..ca3387c58ccf 100644 --- a/src/core/vector/qgsvectorlayerprofilegenerator.cpp +++ b/src/core/vector/qgsvectorlayerprofilegenerator.cpp @@ -971,14 +971,7 @@ bool QgsVectorLayerProfileGenerator::generateProfileForLines() // get features from layer QgsFeatureRequest request; request.setDestinationCrs( mTargetCrs, mTransformContext ); - if ( mTolerance > 0 ) - { - request.setDistanceWithin( QgsGeometry( mProfileCurve->clone() ), mTolerance ); - } - else - { - request.setFilterRect( mProfileCurve->boundingBox() ); - } + request.setFilterRect( mProfileBufferedCurve->boundingBox() ); request.setSubsetOfAttributes( mDataDefinedProperties.referencedFields( mExpressionContext ), mFields ); request.setFeedback( mFeedback.get() ); @@ -1263,14 +1256,7 @@ bool QgsVectorLayerProfileGenerator::generateProfileForPolygons() // get features from layer QgsFeatureRequest request; request.setDestinationCrs( mTargetCrs, mTransformContext ); - if ( mTolerance > 0 ) - { - request.setDistanceWithin( QgsGeometry( mProfileCurve->clone() ), mTolerance ); - } - else - { - request.setFilterRect( mProfileCurve->boundingBox() ); - } + request.setFilterRect( mProfileBufferedCurve->boundingBox() ); request.setSubsetOfAttributes( mDataDefinedProperties.referencedFields( mExpressionContext ), mFields ); request.setFeedback( mFeedback.get() );