Converts a geometry to its curved representation: lines become CompoundCurves, MultiLineStrings become MultiCurves, polygons become CurvePolygons, and MultiPolygons become MultiSurfaces. If the input is already in curved form, the function returns it unchanged.
This function supports 3D geometries and preserves Z coordinates. It also supports CircularStrings and curves.
Syntax
geometry ST_ForceCurve(geometry g);Parameters
| Parameter | Description |
|---|---|
g | The geometry to convert. |
Examples
2D polygon to CurvePolygon
SELECT ST_AsText(ST_ForceCurve(ST_GeomFromText('POLYGON((1 1,2 1,2 2,1 2,1 1))')));Output:
st_astext
-------------------------------------
CURVEPOLYGON((1 1,2 1,2 2,1 2,1 1))
(1 row)该文章对您有帮助吗?