Skip to content
Permalink
Browse files

[Geometry checker] Don't report segment lengths smaller than checker …

…precision, they are either duplicate nodes or degenerate geometries
  • Loading branch information
manisandro committed Sep 28, 2017
1 parent 0f68737 commit 3cc7272770742daf7bef678b7e2bcb37c9efd863
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/analysis/vector/geometry_checker/qgsgeometrysegmentlengthcheck.cpp
@@ -42,7 +42,8 @@ void QgsGeometrySegmentLengthCheck::collectErrors( QList<QgsGeometryCheckError *
QgsPoint pi = geom->vertexAt( 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 ) );

0 comments on commit 3cc7272

Please sign in to comment.
You can’t perform that action at this time.