6

I have many polygons that are adjacent to each other, and others overlap slightly. I need to merge them and sum up their attribute (Area per class). I attach an image of my problem (Screenshot of my merged polygons. Each color represents a landcover class)

I am able to merge the polygons using the function "merge Layers" from the MMQGIS plugin. But the adjancent polygons of the same type are not dissolved, nor their Area summed up.

I tried already using the function Dissolve (per Area) and doesn´t work either.

I am beginner in QGIS. I am working in QGIS 2.12.3 in a PC.

Screenshot of my polygons merged. Each color represent a landcover class

4

You should be able to dissolve based on the landcover attribute rather than area.

The dissolve box allows you to specify a field in the attribute table field of shared values

This will dissolve adjacent polygons which share an attribute.

You can then calculate the area of the polygons in the attribute table using the field calculator.

  • thank you for your help. I tried that one already but the output file is just empty. When I open the attribute table there is nothing in it. I used a merged file as an input file, where all the polygons are merged into one, but the attributes are preserved. – delViento Feb 3 '16 at 14:34
  • It might be that it's having issues with the topology of the shapefile after your merge; for example invalid geometries. You could try the QGIS topology checker (docs.qgis.org/2.0/en/docs/user_manual/plugins/…) or sometimes importing a file into GRASS and back again can solve some issues like this - example here: gis.stackexchange.com/questions/163820/… – Ed Rollason Feb 3 '16 at 14:52
  • @EdRollanson I checked the Topography and seems that there is no problem. However, I managed to split the vector into each class and dissolve each. The problem now is that I have only one feature in the Attribute Table. The Dissolve function summed up the area of the whole vector file... and I need the area per polygon. – delViento Feb 3 '16 at 16:15
  • @EdRollanson (correction) I checked the Topography again and there are overlapping parts of my polygons. How to get rid of this? – delViento Feb 3 '16 at 16:27
  • I'm guessing by your answer below you solved this one. If it worked mark it as a correct answer. – Ed Rollason Feb 4 '16 at 16:48
3

Thanks to the comment of @Ed Rollason I used the Topology checker to understand where was my problem.

Ok, as I said, my layers overlap. But they overlap like a zipper (one on top of each other). After trying many tools (union, difference, merge, dissolve) without success, I found a video that explains the v.clean tool of the Process Toolbox.

In QGIS 2.12.3, go to Processing > Toolbox > GRASS Commands > Vector. I tried v.clean tool like in the video, but I had some geometry errors. Therefore, I used v.dissolve, tolerance = 1 and afterwards the Dissolve tool for a final clean up of the image.

Regarding the attributes, I have the total area of each class.

Link to the video: https://www.youtube.com/watch?v=t1ChPvsC4bU

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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