GIS Tools

Language

Made withfor the GIS community

Simplify Preserving Topology

Reduce vertices while maintaining shared boundaries

Vector Editing

Drop files here or click to browse

Supported formats: GeoJSON

GeoJSON
Original
Simplified

About Topology Preservation

  • With topology: Adjacent polygons share exactly the same edge vertices
  • Without: May create gaps or slivers between polygons
  • Visvalingam: Better for natural features (coastlines, rivers)
  • Douglas-Peucker: Better for angular features (buildings, parcels)

What Is Simplify Preserving Topology?

Simplify Preserving Topology is a vector simplification operation that reduces the number of vertices in a polygon or line layer while guaranteeing that shared boundaries between adjacent features remain shared. Ordinary simplification (Douglas-Peucker, Visvalingam-Whyatt) applied to each feature independently breaks those shared boundaries β€” gaps and overlaps appear between neighbors that used to touch cleanly. Topology-preserving simplification fixes this by operating on the network of shared edges (arcs) rather than on each feature in isolation.

The canonical implementation is TopoJSON, introduced by Mike Bostock, which stores a layer as a set of arcs (shared line segments) plus feature references to those arcs. Simplifying the arcs once automatically preserves every shared boundary. PostGIS implements it as ST_SimplifyPreserveTopology, using a modified Douglas-Peucker that limits simplification where topology would be broken. QGIS has a "Simplify" tool with topology-preserving options. Our tool runs in the browser using the TopoJSON approach for layers with many adjacent features, or a topology-aware Douglas-Peucker for cases where TopoJSON conversion is overkill.

Why does this matter? Because the most common simplification use case is reducing the file size of administrative boundary layers (counties, countries, neighborhoods) for web maps. Ordinary simplification on these layers produces visible gaps between neighbors β€” a cartographic disaster. Topology-preserving simplification reduces the file size by 90% or more while keeping every shared boundary intact.

How Topology-Preserving Simplification Works

The TopoJSON Approach

A TopoJSON representation encodes each shared boundary as a single "arc" that appears once in the topology, plus references from the features that touch it. When you simplify an arc, every feature that uses it gets the same simplified boundary β€” gaps and overlaps are impossible.

The Douglas-Peucker Algorithm

Douglas-Peucker is the classic line simplification algorithm: find the point on the line farthest from the straight segment connecting the endpoints, and if that distance exceeds a tolerance, recursively simplify the two halves. Otherwise, replace the segment with a single straight line. The tolerance parameter controls how aggressive the simplification is.

Topology-Preserving Variant

The topology-preserving version limits simplification where a simplified segment would cross another feature's boundary. PostGIS's ST_SimplifyPreserveTopology uses this approach, trading slightly less compression for guaranteed topology.

Visvalingam-Whyatt

An alternative simplification algorithm that removes the least-important vertex first, where importance is measured by the triangular area formed by the vertex and its neighbors. Often produces more visually pleasing results than Douglas-Peucker.

Key Parameters and Options

Tolerance

The simplification threshold in CRS units. Larger values produce smaller files but coarser shapes.

Algorithm

TopoJSON-based (best for layers with shared boundaries), Douglas-Peucker (fast, standard), or Visvalingam-Whyatt (better-looking at high simplification).

Preserve Shared Boundaries

On by default. Enables the topology-aware mode.

Minimum Feature Size

Features smaller than this are preserved unchanged to avoid disappearing.

Practical Applications

Web Map File Size Reduction

Administrative boundary layers (world countries, US states, counties) are huge at full resolution. Simplifying for web maps reduces file size by 90% or more with no visible quality loss at normal zoom levels.

Tile Generation Pipeline

Vector tile generators pre-simplify data per zoom level. Topology-preserving simplification at each zoom step keeps boundaries clean across zooms.

Thematic Choropleth Maps

Election maps, census statistics, and other choropleth visualizations look cleaner with simplified boundaries, especially at small zoom levels.

Cartographic Generalization

Production cartography requires features to be simplified differently at different scales β€” a technique called cartographic generalization. Topology-preserving simplification is a core step.

Mobile Map Performance

Mobile devices benefit doubly from smaller files (faster download) and fewer vertices (faster rendering).

Data Preservation

Archival copies of large boundary datasets benefit from simplification while preserving the topological integrity needed for future analysis.

Reducing Storage Costs

Simplified layers consume less disk space and database storage. For large organizations this adds up.

Step-by-Step Workflow in gis.tools

  1. Open the Simplify Preserving Topology tool.
  2. Drop a GeoJSON or Shapefile containing the layer to simplify.
  3. Review the vertex count and file size reported by the tool.
  4. Set a tolerance. Start small and increase incrementally.
  5. Pick an algorithm (TopoJSON for adjacent boundaries, Douglas-Peucker for standalone features).
  6. Click Simplify. The result appears with reduced vertex count and smaller file size.
  7. Review visually on the map β€” zoom in to check for detail loss.
  8. Export as GeoJSON, TopoJSON, or Shapefile.
  9. For non-topology-sensitive simplification, see the GeoJSON Simplifier.

Worked Example

A web cartographer is building a US county choropleth map. The raw TIGER counties shapefile is 300 MB with 4.2 million vertices β€” far too large for browser delivery. She drops the file into Simplify Preserving Topology, picks TopoJSON mode, and sets a tolerance of 500 m. The simplification produces a file of 4.2 MB with 52,000 vertices β€” a 98.6% size reduction β€” and every county boundary is still shared with its neighbors (no gaps, no overlaps). She exports as TopoJSON and her choropleth renders smoothly in the browser. The process took about a minute, and the original tax-sensitive population data never left her machine.

Common Pitfalls and Gotchas

  • Too-aggressive tolerance: Tiny features can disappear or collapse to points.
  • Visible corner loss: Fine details in shoreline or urban boundaries may be lost at high tolerance.
  • Non-shared boundaries not preserved: Tiny gaps between non-adjacent features are not a topology concern and may still grow.
  • Mixed geometry types: Simplifying a layer of mixed points, lines, and polygons can produce inconsistent results.
  • Curve vs polyline: Simplification assumes a polyline representation; true curves can be misrepresented.
  • Ring collapse: A polygon with few vertices can collapse to a line or point. Set a minimum vertex count.
  • CRS units: Tolerance is in CRS units β€” meters in UTM, degrees in WGS84. Mismatched units give wildly wrong results.
  • Topology errors in input: If the input has invalid topology, simplification can amplify the issues. Run Geometry Repair first.

Tips for Best Results

  • Reproject to a metric CRS before simplifying so tolerance has a meaningful unit.
  • Start with a conservative tolerance and increase iteratively.
  • Use TopoJSON mode whenever the layer has adjacent features.
  • Preserve a minimum vertex count per feature to avoid collapse.
  • Spot-check simplified features visually at the zoom levels they'll be used at.
  • For multi-scale maps, simplify separately per zoom level.
  • Combine with Coordinate Precision Reducer for further file size reduction.
  • Run GeoJSON Validator & Fixer after simplification.

Comparison with Other GIS Approaches

PostGIS ST_SimplifyPreserveTopology, QGIS Simplify tool with topology option, mapshaper (Matthew Bloch's command-line topology-preserving simplifier), and TopoJSON's simplification pipeline are the established references. Our browser tool uses the same TopoJSON simplification under the hood and matches mapshaper's output for typical layers. For very large datasets, mapshaper on the command line is more scalable.

Performance Considerations

Simplification is O(n log n) with TopoJSON. Layers with millions of vertices take tens of seconds in the browser. Memory is the limit β€” files over ~500 MB become impractical.

Data Privacy and Browser-Based Processing

All simplification is client-side. Confidential boundary data stays in your browser.

Related GIS Concepts

  • Douglas-Peucker algorithm: the classic recursive line simplification method.
  • Visvalingam-Whyatt: an alternative that removes the least-important vertex first.
  • TopoJSON: a format that stores shared arcs once; naturally topology-preserving.
  • Cartographic generalization: the process of adapting data to a specific map scale.
  • Level of Detail (LOD): the idea of storing multiple resolution versions of the same data.

Frequently Asked Questions

What does "preserving topology" mean?

It means that shared boundaries between adjacent features remain shared after simplification β€” no gaps or overlaps appear.

Which algorithm should I use?

TopoJSON for layers with many adjacent features. Douglas-Peucker for standalone features. Visvalingam-Whyatt for higher visual quality at aggressive simplification.

How do I pick a tolerance?

Start at 0.1% of the layer's bounding box diagonal and adjust. In meters, 100-1000 m is a typical starting point for administrative boundaries.

Can I simplify lines too?

Yes β€” topology-preserving simplification works for LineStrings as well as Polygons.

What's the file size reduction typically?

For administrative boundaries at web map scales, 90-99% file size reduction is common.

Related Tools on gis.tools

100% client-side processing - your data stays private and never leaves your device