This topic describes the ST_ForceCurve function. This function converts a geometry object into its curved representation.

Syntax

geometry  ST_ForceCurve(geometry  g);

Parameters

Parameter Description
g The geometry object that you want to specify.

Description

  • The following list describes the conversions of different geometry objects:
    • A line object is converted into a CompoundCurve object.
    • A MultiLines object is converted into a MultiCurve object.
    • A polygon object is converted into a CurvePolygon object.
    • A MultiPolygons is converted into a MultiSurface object.
  • If the geometry object that you specified is in curved representation, the ST_ForceCurve function returns the original geometry object.
  • This function supports 3D objects and does not delete z coordinates.
  • This function supports circular strings and curves.

Examples

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)