Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to:
Databricks SQL
Databricks Runtime 17.1 and above
Important
This feature is in Public Preview.
Note
This feature is not available on Databricks SQL Classic warehouses. To learn more about Databricks SQL warehouses, see SQL warehouse types.
Simplifies the input GEOMETRY value using the Douglas-Peucker algorithm.
Syntax
st_simplify ( geo, tolerance )
Arguments
geo: AGEOMETRYvalue.tolerance: ADOUBLEvalue that is the distance value used for the simplification. The distance units are those of the CRS of the input geometry.
Returns
A value of type GEOMETRY, representing the simplified geometry.
Points and multipoints remain unchanged. If the input is a geometry collection, the elements of the collection are simplified recursively. If the input geometry has M coordinates they are dropped.
The SRID value of the output geometry is the same as that of the input value.
The function returns NULL if any of the inputs is NULL.
Examples
-- Simplifies linestring with tolerance 0.2.
> SELECT st_astext(st_simplify(st_geomfromtext('LINESTRING(0 0,5.1 0,10 0,10 3,10 8,16 9)'), 0.2));
LINESTRING(0 0,10 0,10 8,16 9)
-- Returns unchanged point geometry.
> SELECT st_astext(st_simplify(st_geomfromtext('POINT(1 2)'), 1.0));
POINT(1 2)