Converts a geometry object to its curved representation.
Syntax
geometry ST_ForceCurve(geometry g);Parameters
| Parameter | Description |
|---|---|
g | The geometry object to convert. |
Description
ST_ForceCurve converts linear geometry types to their curve equivalents:
Line →
CompoundCurveMultiLineString→MultiCurvePolygon →
CurvePolygonMultiPolygon→MultiSurface
If the input is already in curved representation, the function returns it unchanged.
The function supports 3D objects and preserves Z coordinates. It also supports circular strings and curves.
Example
SELECT ST_AsText(ST_ForceCurve(ST_GeomFromText('POLYGON((1 1,2 1,2 2,1 2,1 1))')));
st_astext
-------------------------------------
CURVEPOLYGON((1 1,2 1,2 2,1 2,1 1))
(1 row)该文章对您有帮助吗?