How to transform a multipart into a singlepart object in QGIS

Let's assume that we want to check if there are any multipart objects in our QGIS project. Let's start with the sample project:

QGIS multipart to singleparts

We configure the Topology Checker:

QGIS Topology Checker

In this example, we have two multipart objects.

QGIS two multipart objectes

To fix it:

Vectorial > Geoprocessing tools > Geometry tools > Multipart to singleparts

When we open the attribute table, we see the repeated field (there are multiple segments in an object). The goal is to transform the repeated field into a single element.

Repeated attribute table field

This segment is the one that is causing the problem (it has the first vertex of the geometry).

Segment causing problem

This segment was created first, but that means it doesn't have the first/last vertex at the beginning/end. We will separate the vertex lightly to create continuity:

QGIS continuity

At this point, we can dissolve the line, so that the attribute table has a single field:

Vectorial > Geoprocessing tools > Dissolve

Now, the line has the first vertex at the beginning:

First vertex

And the last vertex at the end:

Last vertex

Finally, we need to edit the segment and leave it as it was originally:

Leaving object as it was originally

We will use the magnet tool for that:

Magnet tool

Here is the final result:

Final result

Hi, I'm Erik, an engineer from Barcelona. If you like the post or have any comments, say hi.