Skip to content
Permalink
Browse files

Show warning when adding more than 1 part to single geometry layers

  • Loading branch information
tudorbarascu authored and 3nids committed Jan 16, 2017
1 parent 50e5d97 commit e7c9b74afa96261cb1f3cc2c3c631a0a034420b3
Showing with 10 additions and 0 deletions.
  1. +10 −0 src/app/qgsmaptooladdpart.cpp
@@ -65,6 +65,10 @@ void QgsMapToolAddPart::cadCanvasReleaseEvent( QgsMapMouseEvent * e )
return;
}

bool isGeometryEmpty = false;
if ( vlayer->selectedFeatures()[0].geometry().isEmpty() )
isGeometryEmpty = true;

if ( !checkSelection() )
{
stopCapturing();
@@ -194,6 +198,12 @@ void QgsMapToolAddPart::cadCanvasReleaseEvent( QgsMapMouseEvent * e )
vlayer->endEditCommand();

vlayer->triggerRepaint();

if (( !isGeometryEmpty ) && QgsWkbTypes::isSingleType( vlayer->wkbType() ) )
{
emit messageEmitted( tr( "Add part: Feature geom is single part and you've added more than one" ), QgsMessageBar::WARNING );
}

return;
}

0 comments on commit e7c9b74

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