Name
ST_ForceCurve — 如果适用,将几何图形向上转换为其曲线类型。
Synopsis
geometry ST_ForceCurve(
geometry g)
;
描述
将几何图形转换为其曲线表示(如果适用):直线变为复合曲线,多线变为多曲线,多边形变为曲线多边形变为多曲面。如果几何图形输入已经是曲线表示,则返回与输入相同的表示。
可用性:2.2.0
This function supports 3d and will not drop the z-index.
This method supports Circular Strings and Curves
示例
SELECT ST_AsText(
ST_ForceCurve(
'POLYGON((0 0 2, 5 0 2, 0 5 2, 0 0 2),(1 1 2, 1 3 2, 3 1 2, 1 1 2))'::geometry
)
);
st_astext
----------------------------------------------------------------------
CURVEPOLYGON Z ((0 0 2,5 0 2,0 5 2,0 0 2),(1 1 2,1 3 2,3 1 2,1 1 2))
(1 row)