Skip to content
Permalink
Browse files

difference: skip empty geometries, convert to multi-part geometries

  • Loading branch information
wonder-sk committed Apr 25, 2018
1 parent d2513e0 commit 57e5b9f1a7af20e1c4db18b6dea0ef8eb274f917
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/analysis/processing/qgsoverlayutils.cpp
@@ -83,6 +83,10 @@ void QgsOverlayUtils::difference( const QgsFeatureSource &sourceA, const QgsFeat
geom = geom.difference( geomB );
}

// if geomB covers the whole source geometry, we get an empty geometry collection
if ( geom.isEmpty() )
continue;

const QgsAttributes attrsA( featA.attributes() );
switch ( outputAttrs )
{
@@ -100,6 +104,7 @@ void QgsOverlayUtils::difference( const QgsFeatureSource &sourceA, const QgsFeat
}

QgsFeature outFeat;
geom.convertToMultiType();
outFeat.setGeometry( geom );
outFeat.setAttributes( attrs );
sink.addFeature( outFeat, QgsFeatureSink::FastInsert );

0 comments on commit 57e5b9f

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