Back to Elasticsearch

St Simplifypreservetopology

docs/reference/query-languages/esql/kibana/docs/functions/st_simplifypreservetopology.md

9.4.1676 B
Original Source

% This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it.

ST SIMPLIFYPRESERVETOPOLOGY

Simplifies the input geometry by applying a topology-preserving variant of the Douglas-Peucker algorithm with a specified tolerance. Vertices that fall within the tolerance distance from the simplified shape are removed. Unlike ST_SIMPLIFY, the resulting geometry is guaranteed to be topologically valid.

esql
ROW wkt = "POLYGON ((7.998 53.827, 9.470 53.068, 15.754 53.801, 16.523 57.160, 11.162 57.868, 8.064 57.445, 6.219 55.317, 7.998 53.827))"
| EVAL simplified = ST_SIMPLIFYPRESERVETOPOLOGY(TO_GEOSHAPE(wkt), 0.7)