[GIS] way to create multipart from singlepart features based on selected features only

multipartqgis

QGIS has a tool for creating multipart features in the Geometry Tools section. However, this is applied to a whole layer, which leads to the yellow selection in the image below when used (selecting the pentagon selects the stripes as well). I only want to join the three stripes, though. Right now I'm accomplishing this by saving the parts I want to join as a new layer, executing the tool and merging them back to the source layer. However this is quite tedious and unproductive. Is there a better way?

enter image description here

Best Answer

There is an option (in QGIS 2.6.1 anyway) where you can select a Unique ID Field:

  1. Select your desired features
  2. Access the Field Calculator
  3. Create a new field and check the option to update your selected features
  4. Enter a value and save the edits (this will give the selected features the same value and leaves the value for the non-selected features as NULL)
  5. Select this field when using the Singleparts to Multiparts tool.

Hope this helps!