7

I have a grid of polygons as in the figure below;

enter image description here

I need to dissolve the polygons into a single feature. I used the Dissolve tool on QGIS without specifying any dissolve field. The QGIS result is shown below;

enter image description here

In the attribute table, there is only one feature but the feature contains multi-parts. Performing the same operation on ArcMap, I got the result below which is the expected output. Still a single multipart feature but a finer polygon with lesser vertices. enter image description here

Any idea on why QGIS behaves that way and how to get my expected result with QGIS?

EDIT: A link to the layer. https://drive.google.com/file/d/1FY-bmamtvznPKaUPzBrAvyYOf6q_-4VU/view?usp=sharing

4
  • 1
    can you post your file for further inspection?
    – Kurt
    Feb 13, 2022 at 10:09
  • 5
    I guess that some of the adjacent hexagons do not have exactly same coordinates and hexagons have small gaps or overlaps. ArcMAP is probably using some tolerance while QGIS doesn't. Try to use Snap points to grid tool before dissolve.
    – user30184
    Feb 13, 2022 at 10:25
  • 1
    @Kurt I already added a link to the shapefile
    – Ahmad Raji
    Feb 13, 2022 at 11:50
  • 1
    @user30184 I also thought about that. Is there a way to set some distance tolerance in QGIS?
    – Ahmad Raji
    Feb 13, 2022 at 11:51

4 Answers 4

12

First, use "Vector geometry > Snap geometries to layer" tool. Use the grid layer as input and reference layer with tolerance 0.00001. Then, use "Dissolve" tool.

enter image description here

6

In this specific case it also works to update the geometry using the field calculator:

  • expression to use: geom_from_wkt(geom_to_wkt($geometry,6))

enter image description here

then use the dissolve algorithm:

enter image description here

4

The buffer tool has the option to dissolve the result. Depending on your use case choose a marginal buffer distance.I used 0,0001 degrees and the result is around 12m bigger than your data which seems acceptable with the total extent it has.Buffer tool and result

3

OpenJUMP has a tool "Show vertices in fence" that can be used for evaluating what tolerance to use for snapping. For example in this place

enter image description here

the difference in the coordinates of the vertices is minimal

enter image description here

I had a try with QGIS "Snap to grid" tool with a tolerance of 0.0000000001 and that was enough for getting the desired result.

Your Answer

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

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