Skip to content

Commit 5e66cd2

Browse files
committed
Fix merge lines in dissolve
1 parent bb78d1c commit 5e66cd2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/analysis/processing/qgsalgorithmdissolve.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,8 @@ QVariantMap QgsDissolveAlgorithm::processAlgorithm( const QVariantMap &parameter
215215
return processCollection( parameters, context, feedback, [ & ]( const QVector< QgsGeometry > &parts )->QgsGeometry
216216
{
217217
QgsGeometry result( QgsGeometry::unaryUnion( parts ) );
218+
if ( QgsWkbTypes::geometryType( result.wkbType() ) == QgsWkbTypes::LineGeometry )
219+
result = result.mergeLines();
218220
// Geos may fail in some cases, let's try a slower but safer approach
219221
// See: https://issues.qgis.org/issues/20591 - Dissolve tool failing to produce outputs
220222
if ( ! result.lastError().isEmpty() && parts.count() > 2 )
@@ -227,7 +229,7 @@ QVariantMap QgsDissolveAlgorithm::processAlgorithm( const QVariantMap &parameter
227229
for ( const auto &p : parts )
228230
{
229231
result = QgsGeometry::unaryUnion( QVector< QgsGeometry >() << result << p );
230-
if ( QgsWkbTypes::flatType( result.wkbType() ) == QgsWkbTypes::LineString )
232+
if ( QgsWkbTypes::geometryType( result.wkbType() ) == QgsWkbTypes::LineGeometry )
231233
result = result.mergeLines();
232234
if ( feedback->isCanceled() )
233235
return result;

0 commit comments

Comments
 (0)