All Products
Search
Document Center

ApsaraDB RDS:ST_LineToCurve

Last Updated:Mar 28, 2026

ST_LineToCurve converts a LineString or Polygon to a CircularString or Curved Polygon. The resulting geometry uses far fewer points to represent the same curve.

Syntax

geometry ST_LineToCurve(geometry geomANoncircular);

Parameters

ParameterDescription
geomANoncircularThe LineString or Polygon geometry to convert.

Description

ST_LineToCurve approximates the input geometry as a circular arc representation, which requires significantly fewer points than the original.

If the input geometry is not curved enough to clearly represent a curve, the function returns the original input geometry unchanged.

Examples

The following example converts a circular polygon (generated by ST_Buffer) into its curved equivalent.

SELECT ST_AsText(ST_LineToCurve(ST_Buffer('POINT(0 0)', 1)));

Result:

CURVEPOLYGON(CIRCULARSTRING(1 0,-1 0,1 0))

See also

  • ST_CurveToLine — converts a CircularString or Curved Polygon back to a LineString or Polygon