All Products
Search
Document Center

ApsaraDB RDS:ST_SimplifyVW

Last Updated:Mar 28, 2026

ST_SimplifyVW returns a simplified version of the input geometry using the Visvalingam-Whyatt algorithm.

Syntax

geometry ST_SimplifyVW(geometry geomA, float tolerance);

Parameters

ParameterDescription
geomAThe input geometry object to simplify.
toleranceThe tolerance that you want to specify.

Usage notes

  • Simplification applies to the component line and polygon elements of the input geometry. Use this function on any geometry type, including GeometryCollection — each element is simplified individually.

  • The supported multi-geometry types for direct simplification are MultiLineString, MultiPolygon, and MultiPoint.

  • The returned geometry may lose simplicity.

  • This function may produce invalid geometry by altering topology. To preserve topology and ensure validity, use ST_SimplifyPreserveTopology instead.

  • This function supports 3D geometry. The Z values of input vertices influence the simplification result.

Examples

The following example compares ST_Simplify (Douglas-Peucker algorithm) and ST_SimplifyVW (Visvalingam-Whyatt algorithm) on the same LINESTRING, both with a tolerance of 0.5.

SELECT
  g,
  ST_Simplify(g, 0.5),
  ST_SimplifyVW(g, 0.5)
FROM (
  SELECT 'LINESTRING(0 0,2 2,3 1,3.5 1.5,5 0,5.25 0.25,5.5 0)'::geometry AS g
) AS t;

123