Skip to content

Commit a2018de

Browse files
committedFeb 22, 2019
[processing] Merge lines on dissolve
This is a difference between how polygons and lines are handled on dissolve. Neighbouring polygons are merged automatically, while lines are collected as MultiLineString. With this patch it will be possible to call multipart to singlepart on dissolved line layers to extract spatially separated parts of a linestring.
1 parent 130f3ed commit a2018de

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed
 

‎src/analysis/processing/qgsalgorithmdissolve.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,8 @@ QVariantMap QgsDissolveAlgorithm::processAlgorithm( const QVariantMap &parameter
227227
for ( const auto &p : parts )
228228
{
229229
result = QgsGeometry::unaryUnion( QVector< QgsGeometry >() << result << p );
230+
if ( QgsWkbTypes::flatType( result.wkbType() ) == QgsWkbTypes::LineString )
231+
result = result.mergeLines();
230232
if ( feedback->isCanceled() )
231233
return result;
232234
}

0 commit comments

Comments
 (0)
Please sign in to comment.