Sunday, March 26, 2017

Assigning single attribute to multi geometric features in QGIS

There are situations when you will want as many as possible geometric features within a shapefile layer to share the same attribute information within the attribute table.

This kind of scenario is commonly seen when representing Islands. The attribute data is the same, but the geometric representation of the Islands (in polygon) will be separated from each other to give way too water bodies.

As an example, am going to use a Nigerian state the has Islands (Bayelsa state). So, to digitize Bayelsa into wards polygons we have to deal with Islands. And here I have three polygons representing the same ward with ward_code 12 as seen below.

So, the task here is to merge or combine these same attributes into one and all the three polygons will share that same attribute information/row.



In QGIS, to make multiple polygons share the same attribute proceed like thus:-
1) First digitize the Islands polygons and assign the same attributes as usual
2) Go to Vector Menu >> Geometry Tools >> Singleparts to Multiparts


3) The next window will prompt you for the input layer (from a drop-down list) and the Unique ID field (Ward_Code) and you can specify an output file name. Select the appropriate information and click on run.


4) You should now have multi polygons sharing one row of your attribute table


Alternative method


Alternatively, you could use the "Merge Selected Features" command available in the Advanced Digitizing Toolbar as seen below:-


Select the polygons you want to merge there attributes and click on "Merge Selected Features" within the "Advanced Digitizing Toolbar", configure the attributes accordingly and click on "Ok".


That is it.
Thanks for following.

No comments:

Post a Comment