From 3cc7272770742daf7bef678b7e2bcb37c9efd863 Mon Sep 17 00:00:00 2001 From: Sandro Mani Date: Thu, 28 Sep 2017 16:58:04 +0200 Subject: [PATCH] [Geometry checker] Don't report segment lengths smaller than checker precision, they are either duplicate nodes or degenerate geometries --- .../vector/geometry_checker/qgsgeometrysegmentlengthcheck.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/analysis/vector/geometry_checker/qgsgeometrysegmentlengthcheck.cpp b/src/analysis/vector/geometry_checker/qgsgeometrysegmentlengthcheck.cpp index e8c20cc07d7..6e1f508bb31 100644 --- a/src/analysis/vector/geometry_checker/qgsgeometrysegmentlengthcheck.cpp +++ b/src/analysis/vector/geometry_checker/qgsgeometrysegmentlengthcheck.cpp @@ -42,7 +42,8 @@ void QgsGeometrySegmentLengthCheck::collectErrors( QListvertexAt( QgsVertexId( iPart, iRing, iVert ) ); QgsPoint pj = geom->vertexAt( QgsVertexId( iPart, iRing, jVert ) ); double dist = qSqrt( QgsGeometryUtils::sqrDistance2D( pi, pj ) ); - if ( dist < minLength ) + // Don't report very small lengths, they are either duplicate nodes or degenerate geometries + if ( dist < minLength && dist > mContext->tolerance ) { QgsPointXY pos( 0.5 * ( pi.x() + pj.x() ), 0.5 * ( pi.y() + pj.y() ) ); errors.append( new QgsGeometryCheckError( this, layerFeature, pos, QgsVertexId( iPart, iRing, iVert ), dist * layerToMapUnits, QgsGeometryCheckError::ValueLength ) );