Skip to content
Permalink
Browse files

[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.
  • Loading branch information
m-kuhn committed Feb 22, 2019
1 parent 130f3ed commit a2018debfb8abd22bf429820926d46dcb8e276ee
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/analysis/processing/qgsalgorithmdissolve.cpp
@@ -227,6 +227,8 @@ QVariantMap QgsDissolveAlgorithm::processAlgorithm( const QVariantMap &parameter
for ( const auto &p : parts )
{
result = QgsGeometry::unaryUnion( QVector< QgsGeometry >() << result << p );
if ( QgsWkbTypes::flatType( result.wkbType() ) == QgsWkbTypes::LineString )
result = result.mergeLines();
if ( feedback->isCanceled() )
return result;
}

0 comments on commit a2018de

Please sign in to comment.
You can’t perform that action at this time.