mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
[Geometry checker] Don't report segment lengths smaller than checker precision, they are either duplicate nodes or degenerate geometries
This commit is contained in:
parent
0f68737976
commit
3cc7272770
@ -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 ) );
|
||||
|
Loading…
x
Reference in New Issue
Block a user