Short answer
For a polygon map to be analytically usable, its polygons must form a clean planar partition: no gaps, no overlaps, no slivers, and every geometry individually valid. In QGIS you verify this with two complementary tools. The Topology Checker plugin tests relationships between features (gaps, overlaps, must-not-have-duplicates). Vector > Geometry Tools > Check Validity and Processing > Fix geometries test and repair individual geometries (self-intersections, unclosed rings, wrong ring orientation).
Most polygon errors trace back to digitising without topological editing and snapping enabled, so the cheapest fix is preventing them at the editing stage rather than cleaning them afterwards.
The two kinds of error
It helps to separate them because the tools are different.
Geometry validity is a property of one feature. Under the OGC Simple Features rules, a valid polygon has a closed exterior ring, no self-intersections, interior rings (holes) that lie inside the exterior and do not cross it, and correct ring orientation. A "bowtie" polygon whose boundary crosses itself is invalid. QGIS reports these with Check Validity, which can use either the QGIS engine or the stricter GEOS engine. The GEOS engine is the one that matters because downstream tools (intersect, dissolve, area) and PostGIS use GEOS, and they will refuse or misbehave on invalid input.
Topological relationships are properties of a feature set. Even when every polygon is individually valid, the layer can still have:
- Gaps - unfilled space between polygons that are supposed to be edge-matched (adjacent geological units, land parcels, administrative areas).
- Overlaps - the same ground claimed by two polygons, which double-counts area and breaks attribute joins.
- Slivers - tiny, long, thin polygons created when two boundaries that should coincide were digitised a fraction apart. A sliver typically has a very small area but a relatively large perimeter, so the area-to-perimeter ratio (or a Polsby-Popper compactness score) is a reliable detector.
Step-by-step workflow
- Fix individual geometries first. Run Processing > Fix geometries (
native:fixgeometries). It closes rings, resolves self-intersections by buffering at zero where needed, and orders rings correctly. Always do this before any topology rule check, because invalid geometries produce misleading relationship results. - Enable the Topology Checker. Plugins > Manage and Install > activate "Topology Checker", then open it from the toolbar. Configure rules for your layer:
must not have gapsmust not overlapmust not have duplicates- for shared boundaries with a second layer,
must not overlap withandmust be covered by
- Run the validation. The panel lists each error with its location; double-click to zoom. Errors are not auto-fixed, so this is your worklist.
- Repair with topological editing. Turn on Project > Snapping Options, enable snapping for the layer, set a tolerance (for example 5 px or a metric value such as 0.5 m), and turn on Topological editing and Avoid overlap on active layer. Then move the offending vertices so shared boundaries coincide. Topological editing means moving a shared vertex updates all polygons that touch it, which is what keeps the partition clean.
- Eliminate residual slivers. Run Processing > Eliminate selected polygons (
qgis:eliminateselectedpolygons) after selecting slivers by an attribute expression such as:
Eliminate merges each sliver into the neighbour with the longest shared border.$area < 50 AND ($area / $perimeter) < 0.5 - Re-run the Topology Checker to confirm a clean result before delivery.
The snapping tolerance, and why it is the root cause
When two adjacent polygons are digitised independently, their shared boundary vertices almost never land on exactly the same coordinate. The microscopic offset produces either a gap (boundaries pulled apart) or an overlap/sliver (boundaries crossed). Setting a snapping tolerance forces a new vertex onto an existing one within that distance, so the shared boundary is literally the same coordinates in both polygons. Choose the tolerance to be larger than your digitising jitter but smaller than the smallest real feature you must preserve. Too large and you collapse genuine narrow features; too small and slivers slip through.
A command-line and database cross-check
For batch validation outside the GUI, GDAL/OGR and PostGIS are decisive:
-- list invalid geometries and why
SELECT id, ST_IsValidReason(geom)
FROM units
WHERE NOT ST_IsValid(geom);
-- repair in place
UPDATE units SET geom = ST_MakeValid(geom)
WHERE NOT ST_IsValid(geom);
ST_IsValidReason returns a human-readable diagnosis ("Self-intersection", "Ring Self-intersection") and a coordinate, which is far faster than hunting visually on a large layer. To detect overlaps across a layer, a self-join on ST_Overlaps with a GiST index will surface every offending pair.
Common pitfalls and why they happen
- "No errors" but dissolve still fails. The Topology Checker validated relationships, but a geometry is invalid under GEOS. Always run Check Validity with the GEOS engine and Fix geometries first.
- Slivers reappear after editing. Snapping was off or the tolerance was too small while you reshaped boundaries. Re-enable snapping and topological editing.
- Gaps along a project boundary that are actually intended. Not every empty space is an error; the sea, a no-data buffer, or an excluded zone is legitimate. Define the gap rule against the correct extent.
- Eliminate merges a sliver into the wrong neighbour. The longest-shared-border rule is geometric, not semantic. Review attributes after eliminating, especially where the sliver straddles two different units.
Validation
- After repair, the sum of polygon areas should equal the total mapped extent with no overlap double-counting and no gap shortfall (within rounding).
- Re-run both the Topology Checker (zero gaps, zero overlaps) and
ST_IsValid(all true). - Filter by the sliver expression once more; a clean layer returns nothing.
- For edge-matched neighbours, confirm shared boundaries are coincident, not merely close, by overlaying both layers at large scale.
Bathyl perspective
A polygon map is a set of claims about who or what occupies the ground, and an overlap or gap is a contradiction in those claims. We resolve geometry validity and topology before any area, intersection, or attribution step, because every downstream number inherits these errors. Clean topology is what lets a unit map be summed, queried, and trusted.
Related reading
- QGIS Spatial Join Explained
- QGIS Dissolve for Geological Units
- MultiPolygon Problems in GIS
- GIS and spatial analysis