Skip to content
Permalink
Browse files
maintain geometry type on union
  • Loading branch information
roya0045 authored and nyalldawson committed Jan 10, 2022
1 parent 32ca4ad commit db0b556e5d8fe14229f5b6405254e74518b2a84c
Showing with 12 additions and 0 deletions.
  1. +12 −0 src/app/qgisapp.cpp
@@ -10289,6 +10289,18 @@ void QgisApp::mergeSelectedFeatures()
}
return;
}
else if ( !QgsWkbTypes::isMultiType( vl->wkbType() ) )
{
const QgsGeometryCollection *c = qgsgeometry_cast<const QgsGeometryCollection *>( unionGeom.constGet() );
if ( ( c && c->partCount() > 1 ) || !unionGeom.convertToSingleType() )
{
visibleMessageBar()->pushMessage(
tr( "Merge failed" ),
tr( "Resulting geometry type (multipart) is incompatible with layer type (singlepart)." ),
Qgis::MessageLevel::Critical );
}
return;
}

//merge the attributes together
QgsMergeAttributesDialog d( featureList, vl, mapCanvas() );

0 comments on commit db0b556

Please sign in to comment.