Skip to content

Commit 3cc7272

Browse files
committedOct 23, 2017
[Geometry checker] Don't report segment lengths smaller than checker precision, they are either duplicate nodes or degenerate geometries
1 parent 0f68737 commit 3cc7272

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎src/analysis/vector/geometry_checker/qgsgeometrysegmentlengthcheck.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ void QgsGeometrySegmentLengthCheck::collectErrors( QList<QgsGeometryCheckError *
4242
QgsPoint pi = geom->vertexAt( QgsVertexId( iPart, iRing, iVert ) );
4343
QgsPoint pj = geom->vertexAt( QgsVertexId( iPart, iRing, jVert ) );
4444
double dist = qSqrt( QgsGeometryUtils::sqrDistance2D( pi, pj ) );
45-
if ( dist < minLength )
45+
// Don't report very small lengths, they are either duplicate nodes or degenerate geometries
46+
if ( dist < minLength && dist > mContext->tolerance )
4647
{
4748
QgsPointXY pos( 0.5 * ( pi.x() + pj.x() ), 0.5 * ( pi.y() + pj.y() ) );
4849
errors.append( new QgsGeometryCheckError( this, layerFeature, pos, QgsVertexId( iPart, iRing, iVert ), dist * layerToMapUnits, QgsGeometryCheckError::ValueLength ) );

0 commit comments

Comments
 (0)
Please sign in to comment.