Skip to content
Permalink
Browse files
Adds information when a line is 2D closed but Z are differents. While…
… here, add the start point on QgsGeometry Error in QgsGeometryValidator method. Fixes #43582
  • Loading branch information
lbartoletti authored and nyalldawson committed Jun 8, 2021
1 parent 7cda3a8 commit 0659633e9069239d7b57755e96cbd41de85b271e
Showing with 11 additions and 3 deletions.
  1. +11 −3 src/core/qgsgeometryvalidator.cpp
@@ -99,9 +99,17 @@ void QgsGeometryValidator::validatePolyline( int i, const QgsLineString *line, b

if ( !line->isClosed() )
{
QString msg = QObject::tr( "ring %1 not closed" ).arg( i );
QgsDebugMsgLevel( msg, 2 );
emit errorFound( QgsGeometry::Error( msg ) );
QString msg;
if ( line->is3D() && line->is2DClosed() )
{
msg = QObject::tr( "ring %1 not closed, Z mismatch" ).arg( i );
}
else
{
msg = QObject::tr( "ring %1 not closed" ).arg( i );
QgsDebugMsgLevel( msg, 2 );
}
emit errorFound( QgsGeometry::Error( msg, QgsPointXY( line->startPoint().x(), line->startPoint().y() ) ) );
mErrorCount++;
return;
}

0 comments on commit 0659633

Please sign in to comment.