ST_CoverageSimplify
What is ST_CoverageSimplify?
ST_CoverageSimplify is a PostGIS window function that simplifies a set of polygons forming a coverage while keeping their shared borders consistent. Unlike ST_Simplify, which operates per feature and can introduce gaps or overlaps, this function simplifies the underlying edge network so adjacency is preserved.
ST_CoverageSimplify(geometry winset geom, float tolerance, boolean simplifyBoundary = true) WINDOW → geometrytolerance is in the input's SRID units. simplifyBoundary = false keeps the outer boundary of the coverage fixed.
When would you use ST_CoverageSimplify?
Use ST_CoverageSimplify on datasets where polygons must remain adjacent after simplification — administrative boundaries, census tracts, land-cover classifications, or any tiled polygon layer prepared for vector tiles. It is the only correct way to simplify such datasets without breaking their topology.
1SELECT id, ST_CoverageSimplify(geom, 100) OVER () AS simplified
2FROM admin_tracts;FAQs
How is this different from ST_SimplifyPreserveTopology?
ST_SimplifyPreserveTopology preserves per-polygon validity but simplifies each feature independently, which produces gaps and overlaps between neighbours. ST_CoverageSimplify simplifies the shared edge network so neighbouring polygons stay perfectly aligned after simplification — essential for coverages.
What if my input is not a valid coverage?
The function assumes a valid coverage; results on overlapping or gappy input are undefined. Run ST_CoverageInvalidEdges first to find and fix coverage issues before simplifying.
What does simplifyBoundary do?
With simplifyBoundary = true (default), the outer perimeter of the whole coverage is simplified along with internal edges. Set it to false to keep the coverage's outer boundary fixed — useful when that boundary is a separately-authored study area you don't want to alter.
What units is the tolerance in?
The input's SRID units — metres for projected CRSs, degrees for geographic CRSs. For meaningful thresholds on lat/lon coverages, reproject to a metric CRS first.