I once audited a municipal parcel layer that had been maintained for twenty years by a succession of conscientious people. Every parcel was valid. Every attribute was filled in. And when I summed the areas of all parcels in a block and compared them with the area of the block itself, the numbers didn’t match: the parcels overlapped each other by a total of 2,300 square meters, and left gaps totaling 1,100 square meters. Nobody had made a dramatic mistake. Each overlap was a sliver of a few centimeters, where a surveyor had redrawn one boundary without touching the neighbor. Each gap was a hair-thin crack along a shared line. Individually, they were invisible. Together, they meant that the town was apparently taxing the same strip of land twice, and ignoring another strip altogether.
That is the nature of topology-errors/” data-khs-tag=”184″>topology errors. They are not broken geometries. They are broken relationships between geometries: features that should share a boundary but don’t, that should connect but don’t, that should not overlap but do. They hide in plain sight, they quietly corrupt areas, counts and network analysis, and they multiply when data is edited by many hands. In this guide I’ll explain what topology is, the common error types, how to detect them in every major tool, how to fix them safely, and how to build data that cannot develop them.
This article is a deep dive into the fifth item of Top 10 Most Common GIS Errors and How to Fix Them. If the problem is a single broken shape rather than a broken relationship, see How to Fix Invalid Geometry Errors.

What Is Topology?
Topology describes how features relate to each other in space, independent of their exact shape: which polygons share a border, which lines connect at which junctions, which points lie on which lines. It is the difference between a drawing of a road network, which is just lines, and a network, in which the system knows that two roads meet at an intersection. See How Does GIS Work? Layers, Data, and Analysis Explained for the concept.
Topology matters because many operations rely on those relationships being right.
- Area calculations and summaries assume that polygons tile the space without gaps or double coverage.
- Network analysis assumes that connected roads share a node. See Network Analysis and Route Optimization.
- Overlay and dissolve produce slivers and artifacts when boundaries almost, but not exactly, coincide. See Buffer, Clip, Intersect, Union: Overlay Tools Explained.
- Mapping shows unwanted white gaps and overlapping fills.
- Legal and administrative data, such as cadastres, must not have gaps or overlaps.
The Common Topology Errors
Errors in polygon layers
- Overlaps: two polygons cover some of the same area. In a parcel layer or an administrative boundary layer, an overlap is almost always an error.
- Gaps: an unintended hole between polygons that should be adjacent. A gap may be a long, thin crack or a larger missing area.
- Slivers: very thin, elongated polygons, usually produced by overlays between boundaries that nearly coincide, or by two digitizations of the same line. They may be valid shapes, but they are junk.
- Duplicate polygons: the same feature stored twice, exactly or almost exactly.
- Boundaries that don’t coincide: the shared edge of two neighbors is digitized twice, with slightly different vertices, so they neither match nor properly overlap.
- Self-overlap in multipart features: parts of the same feature overlapping each other.
- Polygons that should be covered by another layer but aren’t, such as parcels extending beyond the municipality boundary.
Errors in line layers
- Dangles (undershoots and overshoots): a line end that doesn’t reach the line it should connect to (an undershoot), or that extends beyond it (an overshoot). Both leave a loose end, called a dangle, where there should be a junction.
- Lines that cross but have no node: two roads that intersect but don’t share a vertex at the crossing, so a network treats them as unconnected. (Sometimes correct, as with a bridge and the road under it.)
- Pseudo nodes: a point where exactly two lines meet end to end, and one attribute set could have described both. Often harmless, sometimes unwanted.
- Duplicate lines: two features covering the same path.
- Lines that should be covered by another feature, such as pipes that should run along a road centerline.
- Self-intersecting or self-overlapping lines, where a line doubles back on itself.
- Disconnected network parts, islands that should be connected.
Errors in point layers
- Duplicate points, at the same location.
- Points that should lie on a line or inside a polygon but don’t, such as a house number point that falls outside its parcel, or a valve that is not on its pipe.
Cross-layer errors
- Boundaries of one layer that should follow boundaries of another, such as districts that must align with their municipality outlines.
- Features that should not overlap features of another layer.
Which Gaps and Overlaps Are Real?
Before fixing anything, ask whether the “error” is actually an error. Not every gap and overlap is a mistake.
- Legitimate gaps: lakes in a land use layer, roads between blocks of parcels, unmapped areas, the holes in a patchwork of protected areas. A layer need not cover everything.
- Legitimate overlaps: in some datasets, polygons are allowed to overlap by design, such as overlapping jurisdictions or zones with several simultaneous designations (flood zone and heritage zone), or buffers and service areas.
The rule depends on the layer’s purpose. That is why you define a topology rule for each layer: “parcels must not overlap”, “parcels must not have gaps within the block”, “roads must not have dangles except at the boundary of the study area”. Then the software can tell errors from exceptions.
Step 1: Detect
QGIS
QGIS provides two main tools.
- Topology Checker (a core plugin, which you enable in Plugins > Manage and Install Plugins): add rules to the panel, such as must not have gaps, must not overlap, must not have duplicates, must not have invalid geometries, must not have dangles, must not have multi-part geometries, and must be covered by or must be inside another layer. Run the check, and errors appear as a list and as highlighted markers on the map.
- Geometry Checker (another core plugin): runs a collection of checks, such as overlaps (with an area threshold), gaps, sliver polygons, duplicate nodes, self-intersections and more, and can offer automatic fix methods for each error type, such as merging with a neighbor.
- Processing tools: Check validity, Delete duplicate geometries, Find dangles in some versions through GRASS tools, and the GRASS v.clean tool, a specialized toolkit for cleaning topology. See Best Free and Open-Source GIS Tools.
ArcGIS Pro
- Geodatabase topology: create a topology in a feature dataset, add rules (for example, “Must Not Overlap” for polygons, “Must Not Have Gaps”, “Must Not Have Dangles” for lines, “Must Be Covered By Feature Class Of”), and validate it. Errors are stored and displayed in the Error Inspector, which also offers fixes such as Merge (to the neighbor with the longest shared boundary), Subtract, Create Feature, Snap, Trim, Extend and Mark as Exception.
- Geoprocessing tools: Check Geometry for validity, Find Identical for duplicates, Planarize Lines and Feature To Polygon to build clean topology, and Integrate to snap near-coincident features (it edits the data, so work on a copy).
PostGIS and SQL
You can detect problems with queries. Find overlaps between polygons of the same layer:
-- Pairs of parcels that overlap by more than 0.5 square meters (projected CRS in meters)
SELECT a.parcel_id AS id_a, b.parcel_id AS id_b,
ST_Area(ST_Intersection(a.geom, b.geom)) AS overlap_m2
FROM parcels a
JOIN parcels b
ON a.parcel_id < b.parcel_id
AND a.geom && b.geom
AND ST_Overlaps(a.geom, b.geom)
WHERE ST_Area(ST_Intersection(a.geom, b.geom)) > 0.5
ORDER BY overlap_m2 DESC;Find gaps within a block, by dissolving the polygons and looking at the interior holes:
-- Holes in the union of all parcels (potential gaps)
SELECT ST_Area((d).geom) AS gap_m2, (d).geom AS geom
FROM (
SELECT ST_DumpRings(ST_Union(geom)) AS d
FROM parcels
) t
WHERE (d).path[1] > 0 -- path 0 is the outer ring. Greater than 0 are holes
ORDER BY gap_m2 DESC;Find line ends that appear only once in a network, the candidate dangles:
WITH ends AS (
SELECT id, ST_StartPoint(geom) AS pt FROM roads
UNION ALL
SELECT id, ST_EndPoint(geom) AS pt FROM roads
)
SELECT pt, array_agg(id) AS line_ids
FROM ends
GROUP BY pt
HAVING count(*) = 1;This lists endpoints that don’t coincide with any other line’s endpoint. Some of them are genuine dead ends, such as cul-de-sacs, and the ones next to another line, but not touching it, are undershoots. PostGIS also has a topology extension for storing and managing topological data. See PostGIS: A Practical Introduction and Spatial SQL Cheat Sheet.
Python and GeoPandas
import geopandas as gpd
parcels = gpd.read_file("parcels.gpkg").to_crs(epsg=32631) # projected CRS in meters
tol = 0.5 # ignore overlaps under 0.5 m2
sindex = parcels.sindex
overlaps = []
for i, geom in enumerate(parcels.geometry):
for j in sindex.query(geom, predicate="intersects"):
if j > i:
inter = geom.intersection(parcels.geometry.iloc[j])
if inter.area > tol:
overlaps.append((parcels.index[i], parcels.index[j], inter.area))
print(len(overlaps), "overlapping pairs")The spatial index makes this practical on large layers. See GeoPandas and Shapely: Vector Data in Python.
Visual and statistical clues
- Zoom in on borders at high magnification, with fill transparency, so overlaps appear as darker strips and gaps as white threads.
- Compare totals: the sum of parcel areas against the area of the containing block. A mismatch signals gaps or overlaps.
- Sort by area to find tiny polygons (slivers).
- Look at the shape index: the ratio of perimeter to area is very high for slivers.
Step 2: Decide How to Fix Each Error
The correct fix depends on what the feature should be. Here is a decision framework by error type.
Overlaps between polygons
Question: which polygon is right in the overlap area?
- If one layer or feature is authoritative: subtract the overlap from the other (Difference), so the authoritative polygon keeps the area.
- If neither is better: split the overlap between them, or assign it to the one with the larger share of the boundary, or ask the data owner.
- If the overlap is tiny: merge the sliver into one of the neighbors.
- If it is a duplicate: delete one.
- If the overlap is large: it is not a slivers problem. It is a data conflict that needs human decision, and perhaps field verification.
Gaps between polygons
Question: is the gap real?
- If it is a real unmapped area: leave it, and perhaps add a polygon of its own to say “unmapped”.
- If it is an error: fill by expanding a neighbor to cover it, with the neighbor chosen by the longest shared boundary, or by creating a new polygon for the gap with an appropriate attribute value.
- For hair-thin cracks: snap the boundaries together, within a small tolerance.
Slivers
- Merge them into the neighbor with the longest shared border (called an “eliminate” operation, which dissolves selected small polygons into adjacent ones).
- Prevent them by snapping inputs before overlays.
- Set an area or width threshold above which a polygon is considered real.
Dangles
- Undershoot: extend the line to the target, or snap it.
- Overshoot: trim the line back to the junction.
- Genuine dead end: mark as an exception. Never “fix” a real cul-de-sac.
- Very short spurs: delete if they are noise.
Missing nodes at crossings
- If roads should connect: split both lines at the intersection, so they share a node (planarize, or “split with lines”).
- If it is an overpass: leave unconnected. Use a network model that can represent grade separation.
Duplicates
- Delete the duplicates after confirming that they are identical, and merge any differing attributes first.
Pseudo nodes
- Merge the lines if they have identical attributes and should be one feature, with a Merge lines tool. Leave them if the attributes differ and the break is meaningful.
Points not on their line or polygon
- Snap them to the nearest line, or move them inside the polygon, within a documented tolerance. If the distance is large, verify the point.
Step 3: Fix It (Tool by Tool)
The golden rules before you start
- Work on a copy. Many topology fixes change geometry, and can’t be undone.
- Record the “before” statistics: number of features, total area, total length and the number of errors.
- Fix in a logical order: invalid geometry first, then duplicates, then snapping and sliver removal, then overlaps and gaps.
- Fix with tolerance. Choose a snapping tolerance based on the data’s accuracy.
- Review a sample of the results on the map.
- Re-run the topology check, and compare.
Snapping: the foundation
Snapping moves vertices to coincide with nearby features within a tolerance. It is the main tool for closing hairline gaps, joining dangles and aligning shared boundaries. The key is the tolerance:
- Too small: misses the errors.
- Too large: distorts the data, pulling vertices to wrong features, collapsing small real features.
- Rule of thumb: a few times the positional accuracy of the data, and much smaller than the smallest real feature.
Tools:
- QGIS: Snap geometries to layer (Processing), with tolerance and behavior options. The Geometry Checker also offers fix methods.
- ArcGIS Pro: the Integrate tool (modifies data in place, so use on a copy), and the Snap tool in editing, with the Topology Error Inspector.
- PostGIS:
ST_Snap(geom, reference, tolerance), andST_SnapToGridorST_ReducePrecisionto round coordinates to a grid so that nearly coincident vertices become identical.
Fixing overlaps and gaps in QGIS
- Run the Geometry Checker (or Topology Checker) with rules for overlaps and gaps, and set an area threshold so that you only deal with meaningful ones first.
- For small overlaps, use the fix method “merge with neighbor polygon with the longest shared edge” or “with the largest area”.
- For gaps, use the fix that merges a gap into a neighbor, or create a new feature.
- Alternatively, use the GRASS v.clean tool with the appropriate cleaning methods, such as breaking polygons, removing duplicates, removing small areas and snapping.
- Dissolve slivers into neighbors with Eliminate selected polygons: select the slivers by area, then eliminate them, choosing whether to merge into the neighbor with the largest area or the longest common boundary.
- Re-run the check.
Fixing overlaps and gaps in ArcGIS Pro
- Create a topology in a feature dataset, with rules such as “Must Not Overlap” and “Must Not Have Gaps” for the polygon layer, and a cluster tolerance appropriate to the data.
- Validate the topology, and open the Error Inspector.
- Fix errors with the inspector’s tools: Merge (an overlap or gap is merged into a neighbor, with the longest shared boundary or the largest area as the rule), Subtract, Create Feature, or mark legitimate cases as Exceptions.
- Re-validate until only exceptions remain.
- Use Eliminate to merge slivers produced by overlays.
Fixing dangles and connectivity
- QGIS: snap line ends to other lines, and use tools to extend lines (the Extend lines algorithm in recent versions), trim, and split lines at intersections (Split with lines, or Line intersections combined with Split). GRASS v.clean offers methods for breaking lines at intersections and removing dangles.
- ArcGIS Pro: use the topology rule “Must Not Have Dangles”, fix with Extend, Trim and Snap, and use Planarize Lines to split lines at intersections.
- For networks, after fixing, test that connectivity works: trace from one point, and check that the expected parts are reachable.
Rebuilding polygons from clean lines
When a polygon layer is deeply faulty, a very effective approach is to rebuild it. Extract the boundaries as lines, clean the lines (snap, node at intersections, remove duplicates), then polygonize them to create polygons, and transfer the attributes back using the original polygons as references (for instance, with the point on surface of each new polygon). Because every polygon is built from shared, single lines, gaps and overlaps become impossible. This is the logic of topologically structured data. In PostGIS, ST_Polygonize and ST_Node help, and QGIS offers Polygonize and Lines to polygons.
Using SQL to resolve overlaps with a priority rule
Suppose a “priority” attribute decides which parcel wins an overlap. Subtract higher-priority polygons from lower-priority ones:
-- Remove from each parcel the parts covered by higher-priority parcels
UPDATE parcels p
SET geom = ST_Multi(ST_CollectionExtract(
ST_MakeValid(ST_Difference(p.geom, q.cover)), 3))
FROM (
SELECT a.parcel_id, ST_Union(b.geom) AS cover
FROM parcels a
JOIN parcels b
ON a.parcel_id <> b.parcel_id
AND b.priority > a.priority
AND ST_Overlaps(a.geom, b.geom)
GROUP BY a.parcel_id
) q
WHERE p.parcel_id = q.parcel_id;Test on a copy, and always compare areas before and after. See Spatial SQL Cheat Sheet.
Step 4: Verify
- Re-run the topology check: the errors should be zero, or only documented exceptions.
- Compare totals. Area of the whole layer should equal the area of the block, minus legitimate gaps. Feature counts may change, since slivers disappear.
- Check attributes. Merged features may have conflicting attributes, and must not double count.
- Inspect a sample on the map, especially around the largest changes.
- Check validity again. See How to Fix Invalid Geometry Errors.
- For networks, test routing or tracing.
- Compare against the original to confirm that you didn’t move boundaries more than your tolerance.
- Document what was done, the tolerance, the number of errors fixed and the exceptions.
A Worked Example: Cleaning a Parcel Layer
Problem: the parcel layer of a block has overlaps and gaps. The parcels sum to a different area than the block.
- Back up the layer, and record the statistics: 412 parcels, total area 184,320 square meters, the block area 184,900 square meters.
- Validate geometry. Four invalid parcels are repaired. See How to Fix Invalid Geometry Errors.
- Run topology rules for overlaps and gaps in a Geometry Checker or SQL queries. The result: 37 overlaps, mostly under 1 square meter, with two larger ones (about 15 and 40 square meters), and 52 gaps, mostly thin cracks, plus a few larger pieces.
- Triage: the two larger overlaps are not slivers. Check the survey records: in one, a recent subdivision overlaps the old parcel that was never updated, and in the other the boundary was drawn wrongly. Resolve both by editing with the authoritative source.
- Snap the boundaries with a tolerance of 0.05 meters, based on the survey accuracy, which closes most hairline cracks and tiny overlaps.
- Eliminate the remaining slivers under a threshold by merging each into the neighbor with the longest shared boundary.
- Examine the larger gaps: two are real (a lane and a drainage easement, not parcels), so they are marked as exceptions. One is a missing parcel. Create it from the survey record.
- Re-run the rules. The overlaps are gone, and the gaps remaining are the two legitimate ones.
- Compare totals: the parcels plus the two real gaps now add up to the block area, to within a tiny rounding error.
- Lock it in. Move the data into a geodatabase or a database with topology rules, so that future edits are checked as they are made.
Prevention: Build Data That Can’t Break
The best topology fix is a rule that stops the error from being created.
- Define topology rules at the start, for every layer that matters, and document them.
- Use topology-aware editing. In QGIS, enable topological editing and avoid overlap options in the snapping settings, so that editing a shared boundary updates the neighbor and new polygons don’t overlap existing ones. In ArcGIS Pro, use topology editing tools and geodatabase topology.
- Always snap while digitizing, with a sensible tolerance.
- Edit from shared lines, not from independent polygons.
- Use a database with topology support or constraints, and validate on write. See Enterprise GIS & Spatial Databases: PostGIS, Geodatabases, and Server Architecture.
- Digitize from authoritative boundaries, by reusing, not redrawing, existing lines.
- Snap and clean before overlay, to avoid slivers. See Buffer, Clip, Intersect, Union: Overlay Tools Explained.
- Avoid unnecessary simplification and generalization of shared boundaries. Simplify them consistently.
- Use consistent coordinate precision across layers.
- Train editors, and review edits.
- Run automated topology checks regularly, as part of data maintenance. See Automating Workflows with ModelBuilder and QGIS Processing.
- Send problems back to the source, when the data comes from elsewhere.
- Keep a log of exceptions: gaps and overlaps that are intentionally left.
Quick Reference: Error, Cause, Fix
| Error | Typical cause | Detect with | Fix |
|---|---|---|---|
| Overlap between polygons | Boundaries drawn independently, edit of one without the other | “Must not overlap” rule, SQL overlap query | Subtract, merge small overlaps, resolve large ones with the source |
| Gap between polygons | Hairline crack, missing polygon | “Must not have gaps” rule, hole analysis | Snap, expand neighbor, or add a polygon |
| Sliver polygons | Overlay of nearly coincident boundaries | Area and shape filters | Eliminate (merge to neighbor), snap beforehand |
| Dangle: undershoot | Line stops short of the target | “Must not have dangles” | Extend or snap |
| Dangle: overshoot | Line goes past the target | Same | Trim |
| Lines cross without a node | Missing intersection vertex | Network connectivity test | Split at intersections (unless it is an overpass) |
| Duplicate features | Double import, copy errors | Duplicate checks | Delete duplicates, merge attributes |
| Pseudo nodes | Lines split without reason | Node analysis | Merge lines |
| Point off its line or polygon | Low-accuracy location | “Must be covered by” rule | Snap or move within tolerance |
| Boundaries not matching between layers | Different sources | “Must be covered by” across layers | Align to the authoritative layer |
Common Mistakes
- Fixing without a backup, and without recording the “before” state.
- Choosing a snapping tolerance at random, and distorting the data.
- Snapping before checking validity.
- Treating legitimate gaps and overlaps as errors, and erasing real information.
- Fixing visually in the editor instead of using rules and checks, so errors remain hidden.
- Deleting slivers and losing area, instead of merging them into a neighbor.
- Ignoring attribute consequences when merging or splitting features.
- “Fixing” a cul-de-sac or an overpass that is correct.
- Fixing once and not preventing, so the same errors return.
- Cleaning the layer but not the overlay inputs, so slivers reappear on the next analysis.
- Skipping verification, and trusting the tool’s “no errors” message without comparing areas.
- Not documenting exceptions.
Final Thoughts
Topology errors are the quiet tax on every spatial dataset that has been edited by more than one person. They don’t crash anything. They simply make numbers slightly wrong, networks slightly disconnected and maps slightly ugly, until the day they matter, in a legal dispute, a routing failure or a flood model that leaks through a crack that isn’t there.
The cure is a change in how you think. Stop treating features as independent drawings, and start treating them as parts of a whole, with rules about how they fit. Write the rules down, let the software enforce them, and spend your effort on the real exceptions instead of the thousandth hairline sliver.
Choose one polygon layer that you rely on. Add the rules “must not overlap” and “must not have gaps”, run the check, and look at the result. Whatever you find, you will understand your data better than you did this morning.
Where to go next: continue with Lock Files and Corrupted Geodatabases: Recovery Guide for storage problems, and Shapefile Limitations and Encoding Problems (Field Names, UTF-8) for format-related errors.



