Skip to content
Permalink
Browse files
Fix comparison with square tolerance also in QgsGeometryAngleCheck
  • Loading branch information
mhugent authored and nyalldawson committed Nov 2, 2021
1 parent af8f05a commit bd5d1ce83d1b401157389192b31d60b1e115ba9d
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 bd5d1ce

Please sign in to comment.