Skip to content

Commit

Permalink
maintain geometry type on union
Browse files Browse the repository at this point in the history
  • Loading branch information
roya0045 authored and nyalldawson committed Jan 10, 2022
1 parent 32ca4ad commit db0b556
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/app/qgisapp.cpp
Expand Up @@ -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() );
Expand Down

0 comments on commit db0b556

Please sign in to comment.