Skip to content
Permalink
Browse files
Fix comparison with square tolerance also in QgsGeometryAngleCheck
  • Loading branch information
mhugent authored and nyalldawson committed Nov 3, 2021
1 parent 2726e15 commit 1b3002ee6dad78c8fb280b5e9b613404a5630d3c
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/analysis/vector/geometry_checker/qgsgeometryanglecheck.cpp
@@ -138,7 +138,7 @@ void QgsGeometryAngleCheck::fixError( const QMap<QString, QgsFeaturePool *> &fea
{
changes[error->layerId()][error->featureId()].append( Change( ChangeNode, ChangeRemoved, vidx ) );
// Avoid duplicate nodes as result of deleting spike vertex
if ( QgsGeometryUtils::sqrDistance2D( p1, p3 ) < mContext->tolerance &&
if ( QgsGeometryUtils::sqrDistance2D( p1, p3 ) < ( mContext->tolerance * mContext->tolerance ) &&
QgsGeometryCheckerUtils::canDeleteVertex( geometry, vidx.part, vidx.ring ) &&
geometry->deleteVertex( error->vidx() ) ) // error->vidx points to p3 after removing p2
{

0 comments on commit 1b3002e

Please sign in to comment.