Navigation Menu

Skip to content

Commit

Permalink
Adds information when a line is 2D closed but Z are differents. While…
Browse files Browse the repository at this point in the history
… here, add the start point on QgsGeometry Error in QgsGeometryValidator method. Fixes #43582
  • Loading branch information
lbartoletti authored and nyalldawson committed Jun 19, 2021
1 parent c57d45b commit 009b649
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/core/qgsgeometryvalidator.cpp
Expand Up @@ -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;
}
Expand Down

0 comments on commit 009b649

Please sign in to comment.