ST_ForceCurve

更新时间:
复制 MD 格式

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

ParameterDescription
gThe 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)