## Name

ST_SimplifyPreserveTopology — 使用Douglas-Peucker算法返回几何图形的简化且有效表示。

## Synopsis

`geometry ST_SimplifyPreserveTopology(`geometry geom, float tolerance`)`;

## 描述

 该函数不保留多边形之间共享的边界。如果需要保留共享边界，请使用ST_CoverageSimplify。

## 示例

```SELECT  ST_Npoints(geom) AS np_before,
ST_NPoints(ST_SimplifyPreserveTopology(geom, 0.5)) AS np05_notquitecircle,
ST_NPoints(ST_SimplifyPreserveTopology(geom, 1))   AS np1_octagon,
ST_NPoints(ST_SimplifyPreserveTopology(geom, 10))  AS np10_square,
ST_NPoints(ST_SimplifyPreserveTopology(geom, 100)) AS np100_stillsquare
FROM (SELECT ST_Buffer('POINT(1 3)', 10,12) AS geom) AS t;

np_before | np01_notbadcircle | np05_notquitecircle | np1_octagon | np10_square | np100_stillsquare
-----------+-------------------+---------------------+-------------+-------------+-------------------
49 |                33 |                  17 |           9 |           5 |                 5
```

```SELECT ST_SimplifyPreserveTopology(
'MULTILINESTRING ((20 180, 20 150, 50 150, 50 100, 110 150, 150 140, 170 120), (20 10, 80 30, 90 120), (90 120, 130 130), (130 130, 130 70, 160 40, 180 60, 180 90, 140 80), (50 40, 70 40, 80 70, 70 60, 60 60, 50 50, 50 40))',
40);
```

```SELECT ST_SimplifyPreserveTopology(
'MULTIPOLYGON (((90 110, 80 180, 50 160, 10 170, 10 140, 20 110, 90 110)), ((40 80, 100 100, 120 160, 170 180, 190 70, 140 10, 110 40, 60 40, 40 80), (180 70, 170 110, 142.5 128.5, 128.5 77.5, 90 60, 180 70)))',
40);
```