ST_SimplifyVW — Liefert eine vereinfachte Darstellung einer Geometrie unter Verwendung des Visvalingam-Whyatt-Algorithmus
geometry ST_SimplifyVW(geometry geom, float tolerance);
Returns a simplified representation of a geometry using the Visvalingam-Whyatt algorithm. The simplification tolerance is an area value, in squared units of the input SRS. Simplification removes vertices which form "corners" with area less than the tolerance. The result may not be valid even if the input is.
Die Funktion kann mit jeder Art von Geometrie (einschließlich GeometryCollections) aufgerufen werden, aber nur Linien- und Polygonelemente werden vereinfacht. Die Endpunkte der linearen Geometrie bleiben erhalten.
|
|
|
Die zurückgegebene Geometrie kann ihre Einfachheit verlieren (siehe ST_IsSimple), die Topologie bleibt möglicherweise nicht erhalten, und polygonale Ergebnisse können ungültig sein (siehe ST_IsValid). Verwenden Sie ST_SimplifyPreserveTopology, um die Topologie zu erhalten und die Gültigkeit sicherzustellen. ST_CoverageSimplify erhält ebenfalls die Topologie und die Gültigkeit. |
This is a general-purpose simplification function. It may remove narrow polygon spikes when their effective area is below the tolerance, but it is not a dedicated spike-removal or polygon-repair operation. Use ST_IsValid to check the result and ST_MakeValid to repair invalid polygonal output if needed.
Diese Funktion erhält keine gemeinsamen Grenzen zwischen Polygonen. Verwenden Sie ST_CoverageSimplify, wenn dies erforderlich ist.
Diese Funktion kann mit 3D umgehen und die dritte Dimension beeinflusst auch das Ergebnis.
Verfügbarkeit: 2.2.0
This polygon has a narrow spike whose effective area is small enough to be removed by a tolerance of 20 square units.
SELECT geom AS original, ST_SimplifyVW(geom, 20) AS simplified FROM (SELECT 'POLYGON((0 0,10 0,10 10,5.2 10,5 16,4.8 10,0 10,0 0))'::geometry AS geom) AS t;
POLYGON((0 0,10 0,10 10,5.2 10,5 16,4.8 10,0 10,0 0)) | POLYGON((0 0,10 0,10 10,0 10,0 0))
A LineString is simplified with a minimum-area tolerance of 30. For a linear simplification using ST_Simplify, a comparable tolerance would be a length in input-SRS units, so the value here is roughly that linear tolerance squared.
SELECT ST_SimplifyVW(geom, 30) simplified FROM (SELECT 'LINESTRING(5 2,3 8,6 20,7 25,10 10)'::geometry AS geom) AS t;
LINESTRING(5 2,7 25,10 10)
Vereinfachung einer Linie.
SELECT ST_SimplifyVW('LINESTRING (10 10,50 40,30 70,50 60,70 80,50 110,100 100,90 140,100 180,150 170,170 140,190 90,180 40,110 40,150 20)'::geometry,
1600);
LINESTRING(10 10,100 100,100 180,150 170,190 90,150 20)
Vereinfachung eines Polygons.
SELECT ST_SimplifyVW('POLYGON ((20 20,50 60,20 120,40 170,80 180,120 140,180 180,160 130,180 100,180 30,130 70,150 10,20 20))'::geometry,
1600);
POLYGON((20 20,20 120,80 180,160 130,180 30,20 20))
ST_SetEffectiveArea, ST_Simplify, ST_SimplifyPreserveTopology, ST_CoverageSimplify, Topologie ST_Simplify