When dissolving a polygon shapefile I get fragments in the middle (see pictures) in Qgis and R using the functions from rgeos. Has anybody an idea where this comes from and what can be done to deal with this?

original data set showing municipalities original data set showing municipalities

dissolved dataset showing fragments in the middle

dissolved dataset showing fragments in the middle

I would like to have only the contour of all municipalities without the fragments...


2 Answers 2


QGIS includes topology editing tools, so you can repair the un-dissolved municipalities polygons by doing a topology edit on them all at once.

  • Set a Search radius for the maximum gap you would like to fix
  • Set a maximum Snapping distance for vertices to be snapped
  • Select all the polygons
  • Move them from 0,0 to 0,0

(allowing them to search and snap and fix topology errors)

Now perform the dissolve as before on the clean municipalities set and review the results for fragments.

If any fragments exist, measure the sliver width then go back and repeat the process beginning with an original set, adjusting the Snapping distance based on the sliver width...lather, rinse, repeat as necessary.

EDIT: I was asked where to find examples of such editing.

  • I could not follow exactly your answer. Where do I set the search radius and the snapping distance and how do I move them from 0,0 to 0,0?
    – joaoal
    Sep 10, 2016 at 10:10
  • Lesson 6.2 in the QGIS editing tutorial shows how to set snapping environments and edit topology. Instead of using the Select Single Feature, use the Select Multiple and window the entire dataset. You can zoom up to a single displayed node and use Move features from that node to that node (remember that Snapping must be set in order to ensure the data don't shift erroneously.) Sep 21, 2016 at 0:12

Most probably the vertex coordinates did not snap during editing, or got separated during reprojection from one CRS to another. Another typical mistake while digitizing nearly straight lines is to leave out some vertices on one of the adjacent polygons.

You have to fix those artefacts manually after dissolving. In QGIS, use the vertex tools, or delete inner rings.

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