Topology Helpers
Auto-close rings, remove spikes, and fix topology errors
What Are Topology Helpers?
Topology helpers are a set of automated cleanup utilities that fix common geometric errors in vector GIS data: unclosed rings, duplicate vertices, spikes (acute-angle vertices created by digitizing jitter), slivers (tiny polygons from imperfect boundary matches), dangles (line endpoints that should connect but don't), and overlapping neighbors. Topology is the branch of GIS that cares about these relationships β "do two polygons share an edge?", "does this line end exactly at that intersection?", "is this ring actually closed?" β and it matters because nearly every downstream analysis depends on clean topology.
The Topology Helpers tool on gis.tools provides a one-click way to run multiple topology fixes across a layer. It is modeled after QGIS's "Check Validity" and "Fix Geometries" algorithms, ArcGIS's Topology rules, and the PostGIS functions ST_IsValid, ST_MakeValid, and ST_RemoveRepeatedPoints. The fixes are heuristic β topology errors are often ambiguous and a tool can only guess at the intended shape β but the defaults resolve the vast majority of common issues and let you review each change before committing.
Running topology helpers is especially useful after manual digitizing, format conversions (shapefile to GeoJSON can introduce winding-order inconsistencies), or when integrating data from multiple sources with slightly different snapping rules. A five-minute topology cleanup can save hours of downstream debugging.
How Topology Fixing Works
Auto-Close Rings
GeoJSON requires polygon rings to be closed (first vertex equals last vertex). Some exporters, especially older ones, omit the closing vertex. The helper detects unclosed rings and appends the first vertex to close them.
Spike Removal
A spike is a vertex where the incoming and outgoing edges form an angle smaller than a configurable threshold (commonly < 5Β°). Spikes usually come from digitizing jitter or GPS noise. The helper removes the spike vertex, straightening the boundary.
Duplicate Vertex Removal
Consecutive duplicate vertices contribute nothing to the geometry and can confuse downstream algorithms. The helper removes them.
Dangle Snapping
Line endpoints that fall within a tolerance of another line but don't touch it are "dangles." The helper snaps them to the nearest line endpoint or segment.
Sliver Removal
Tiny polygons smaller than an area threshold are often slivers β unintended artifacts of overlay operations. The helper can delete or merge them into neighbors.
Key Parameters and Options
Enabled Checks
Toggle individual checks on or off: close rings, remove spikes, remove duplicates, snap dangles, remove slivers, fix winding order.
Spike Angle Threshold
The angle below which a vertex is considered a spike. Default 5Β° is usually safe.
Sliver Area Threshold
Polygons smaller than this area are treated as slivers. Set in the CRS units.
Snap Tolerance
Distance within which dangles are snapped to nearby features.
Dry Run Mode
Preview all proposed fixes without modifying the data. Review, then commit.
Practical Applications
Parcel Layer Cleanup
Cadastre data from different sources often has minor mismatches at shared boundaries. Topology helpers align them into a clean seamless layer ready for use in a municipal GIS.
Post-Digitizing Cleanup
After a manual digitizing session, topology helpers catch the inevitable stray spikes and duplicate vertices that crept in.
Overlay Artifact Removal
Intersect, union, and erase operations often produce sliver polygons where input edges don't align perfectly. Running topology helpers after overlay is a standard cleanup step.
Road Network Preparation
Routing algorithms require that lines actually touch at intersections. Topology helpers snap dangling endpoints to create a valid routable network.
Shapefile to GeoJSON Conversion
The conversion sometimes introduces ring-winding changes or precision issues. A topology pass normalizes the result.
Data QA Before Publication
Running topology helpers on a dataset before publishing to a public catalog catches many embarrassing errors.
Preparing Data for Spatial Databases
PostGIS requires valid geometries for many functions. Topology helpers transform a messy GeoJSON into a PostGIS-ready one.
Step-by-Step Workflow in gis.tools
- Open the Topology Helpers tool in your browser.
- Drop your GeoJSON, Shapefile, or KML file.
- Enable the checks you want (all are on by default).
- Adjust thresholds if needed β the defaults work for most urban-scale datasets.
- Click Run. A report shows how many issues were detected and fixed.
- Review a sample of fixes on the map preview.
- Export the cleaned layer as GeoJSON, Shapefile, or KML.
Worked Example
A municipal GIS analyst inherits a zoning layer with 1,842 polygons from a contractor. Running the topology helpers reveals 47 unclosed rings, 312 duplicate vertices, 18 spikes, and 9 sliver polygons smaller than 1 mΒ². The defaults fix all of them. She spot-checks a handful on the map, confirms the fixes look right, and exports a clean layer ready for upload to the city GIS server. A cleanup that would have taken an afternoon in QGIS is done in five minutes, entirely in the browser.
Common Pitfalls and Gotchas
- Over-aggressive sliver removal: A small but legitimate polygon can be mistaken for a sliver. Use conservative thresholds.
- Snapping too far: A large snap tolerance can merge unrelated features. Start small.
- Spike removal false positives: A legitimate acute corner (building inner angle) can be flagged as a spike. Review before committing.
- Losing important vertices: Deduplication can delete vertices that are coincident by design. Verify.
- Ring reversal surprises: Fixing winding order flips the sign of area calculations elsewhere.
- Attribute loss: Some topology operations (merging neighbors) drop attributes from one of the merged features.
- CRS-dependent thresholds: Area and distance thresholds are in CRS units; check your CRS before setting them.
- Not a substitute for geometry repair: Topology helpers fix simple issues, not complex self-intersections. For those, use Geometry Repair.
Tips for Best Results
- Run topology helpers after any overlay operation or format conversion.
- Use dry-run mode first to preview changes.
- Start with conservative thresholds and adjust only if needed.
- Cross-check with Polygon Overlap Checker to see remaining issues.
- Export a copy before running β topology fixes can be non-reversible.
- Document what fixes were applied so downstream users can audit.
- Combine with Geometry Repair for severe issues.
Comparison with Other GIS Approaches
QGIS's "Fix Geometries" and "Check Validity" algorithms are the closest desktop equivalents. PostGIS ST_MakeValid handles many issues in SQL. ArcGIS Pro has a full Topology data type with rule-based validation. Our browser helpers cover the common cases with zero install and complete privacy, sitting between a quick Turf.js script and a full topology engine.
Performance Considerations
Topology checks are O(n) to O(n log n) depending on the check. Snapping and sliver detection require spatial indexing. Layers with tens of thousands of features process in a few seconds; much larger layers benefit from desktop or database tools.
Data Privacy and Browser-Based Processing
All cleanup happens client-side. Parcel data, cadastral records, and confidential infrastructure layers never leave your browser.
Related GIS Concepts
- Topology rules: formal relationships that must hold (no overlaps, no gaps, must touch).
- Sliver polygon: a thin polygon produced by imperfect edge matching.
- Dangle: a line endpoint that doesn't connect to another line.
- Winding order: the direction (CW vs CCW) in which a ring's vertices are listed.
- Planar vs network topology: planar requires no overlaps; network allows touching and shared endpoints.
Frequently Asked Questions
What counts as a topology error?
Unclosed rings, duplicate vertices, spikes, slivers, dangles, and overlapping neighbors are the most common.
Will it delete my data?
Only vertices and features that match the configured thresholds. Use dry-run mode to preview.
Can I fix topology for multiple layers at once?
Run the tool on each layer separately; cross-layer topology is more complex and beyond the scope of these helpers.
What if a fix is wrong?
Use undo (see Undo/Redo Edit Stack) or revert to the source file.
How do I choose the right thresholds?
Start with defaults and adjust only if needed. Spike angles around 5Β°, sliver areas less than 1 mΒ², snap tolerances less than 0.5 m are common.
Related Tools on gis.tools
Related Tools
View All ToolsFeature Editor
Move, rotate, and reshape features in the browser
Vector EditingCut Polygon by Line
Split a polygon using a cutting line
Vector EditingVertex Density Visualizer
Identify geometries with excessive vertex counts
Vector EditingDraw Points/Lines/Polygons
Draw new features with optional snapping
Vector EditingSimplify Preserving Topology
Reduce vertices while maintaining shared boundaries
Vector EditingSplit Multipart Features
Split MultiPolygon/MultiLineString into single parts
Vector Editing100% client-side processing - your data stays private and never leaves your device