This topic describes the ST_CurveToLine function. This function converts a CircularString object into a regular LineString object or converts a CurvedPolygon object into a regular Polygon object.

Syntax

geometry  ST_CurveToLine(geometry  curveGeom , float  tolerance , integer  toleranceType , integer  flags);

Parameters

Parameter Description
curveGeom The geometry object that you want to specify.
tolerance The tolerance that you want to specify. Default value: 0.
toleranceType The interpretation of the tolerance parameter. Valid values:
  • 0: This is the default value. The value of the tolerance parameter indicates the maximum number of segments that are allowed for each quadrant.
  • 1: The value of the tolerance parameter indicates the maximum deviation between a line and a curve based on the source unit.
  • 2: The value of the tolerance parameter indicates the maximum angle in radians between generated radii.
flags The bitfield that you want to specify. Valid values:
  • 0: This is the default value.
  • 1: This value indicates that the output is a symmetric object regardless of directions.
  • 2: This value indicates that the angle is retained to prevent the angle or segment lengths from being reduced when the function generates a symmetric output. This parameter does not take effect when the symmetric output flag is off.

Description

  • This function converts each curved geometry object or segment into a linear approximation by dividing each quarter circle into 32 segments.
  • This function is useful in scenarios in which CircularString objects are not supported.

Examples

Comparison between the returned object by using the default parameter settings and the returned object by using the custom parameter settings:
select ST_CurveToLine(g),ST_CurveToLine(g,pi()/4,2) from (select 'CIRCULARSTRING(0 0,0.5 0.5,1 0)'::geometry as g) as test;
12