Name

ST_SimplifyVW — Returns a "simplified" version of the given geometry using the Visvalingam-Whyatt algorithm

Synopsis

geometry ST_SimplifyVW(geometry geomA, float tolerance);

Description

Returns a "simplified" version of the given geometry using the Visvalingam-Whyatt algorithm. Will actually do something only with (multi)lines and (multi)polygons but you can safely call it with any kind of geometry. Since simplification occurs on a object-by-object basis you can also feed a GeometryCollection to this function.

[Note]

Note that returned geometry might loose its simplicity (see ST_IsSimple)

[Note]

Note topology may not be preserved and may result in invalid geometries. Use (see ST_SimplifyPreserveTopology) to preserve topology.

[Note]

This function handles 3D and the third dimmension will affect the result

Availability: 2.2.0

Examples

A linestring that get the efffective area calculated. All points is returned since we give 0 as themin area threashold


select ST_AStext(ST_SimplifyVW(geom,30)) simplified
FROM (SELECT  'LINESTRING(5 2, 3 8, 6 20, 7 25, 10 10)'::geometry geom) As foo; 
-result
 simplified
-----------+-------------------+
LINESTRING(5 2,7 25,10 10)

				

See Also

ST_SetEffectiveArea, ST_Simplify, ST_SimplifyPreserveTopology, Topology ST_Simplify