Skip to content

Commit

Permalink
[Geometry checker] Don't report segment lengths smaller than checker …
Browse files Browse the repository at this point in the history
…precision, they are either duplicate nodes or degenerate geometries
  • Loading branch information
manisandro committed Oct 23, 2017
1 parent 0f68737 commit 3cc7272
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) );
Expand Down

0 comments on commit 3cc7272

Please sign in to comment.