2

Can two polygon layers be merged in QGIS on the basis of a common id?

Update:

Ok , the dissolve tool works fine. But for instance lets say I have 10 polygons. 8 of them are together , so when dissolved they become one big polygon. The other two polygons are somewhere away and I dont want them to dissolve with these other 8. So how do you go about it.

2 Answers 2

5

Yes. You're probably looking for the "Dissolve" tool.

3
  • Ok , the dissolve tool works fine. But for instance lets say I have 10 polygons. 8 of them are together , so when dissolved they become one big polygon. The other two polygons are somewhere away and I dont want them to dissolve with these other 8. So how do you go about it.
    – SNT
    Commented Feb 15, 2012 at 11:26
  • You may want to select somehow the polygons you need to merge (by hand, with a query, with the spatial query tool), then in the editing toolbar you can choose the tool "merge selected".
    – gioman
    Commented Feb 15, 2012 at 12:36
  • 1
    It sounds like you may need to reword your question if this is the case. If you want some but not all, then you wouldn't be dissolving on a common ID. Giovanni's suggestion would work for your case, or you could add an actual common ID for those you want to dissolve. Commented Feb 15, 2012 at 14:38
4

If you have two separate layers (shape files) you have to first merge those together for example using the "merge shape files to one" tool. Then dissolve the polygons. The dissolve tool creates multipart polygons in case of when polygons don't touch each other. You could then convert those multipolygons to single geometries with the Multipart to singleparts tool found from the Geometry tools menu.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.