ST_ToPolygon() method

Converts the geometry to a polygon.

Syntax

geometry-expression.ST_ToPolygon()

Returns

ST_Polygon If the geometry-expression is of type ST_Polygon, returns the geometry-expression. If the geometry-expression is of type ST_CurvePolygon, returns geometry-expression.ST_CurvePolyToPoly(). If the geometry-expression is a geometry collection with a single element of type ST_CurvePolygon, returns that element. If the geometry-expression is the empty set, returns an empty set of type ST_Polygon. Otherwise, raises an exception condition.

Examples

Standards

SQL/MM (ISO/IEC 13249-3: 2006) 5.1.33