Skip to content

Commit 6395dad

Browse files
committed
[processing] Log features that could not be divided in tessellate alg.
1 parent 7363276 commit 6395dad

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/3d/processing/qgsalgorithmtessellate.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ QgsTessellateAlgorithm *QgsTessellateAlgorithm::createInstance() const
7979
return new QgsTessellateAlgorithm();
8080
}
8181

82-
QgsFeatureList QgsTessellateAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingContext &, QgsProcessingFeedback * )
82+
QgsFeatureList QgsTessellateAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingContext &, QgsProcessingFeedback *feedback )
8383
{
8484
QgsFeature f = feature;
8585
if ( f.hasGeometry() )
@@ -106,7 +106,14 @@ QgsFeatureList QgsTessellateAlgorithm::processFeature( const QgsFeature &feature
106106
t.addPolygon( *p, 0 );
107107
}
108108
QgsGeometry g( t.asMultiPolygon() );
109-
g.translate( bounds.xMinimum(), bounds.yMinimum() );
109+
if ( !g.isEmpty() )
110+
{
111+
g.translate( bounds.xMinimum(), bounds.yMinimum() );
112+
}
113+
else
114+
{
115+
feedback->reportError( QObject::tr( "Feature ID %1 could not be divided into triangular components." ).arg( f.id() ) );
116+
}
110117
f.setGeometry( g );
111118
}
112119
}

0 commit comments

Comments
 (0)