Appearance
ST_POLYGON
Creates a GEOGRAPHY polygon from the given LineString.
See also:
Syntax
sql
ST_POLYGON(<linestring>)ST_MAKEPOLYGON is an alias for ST_POLYGON.
Arguments
<linestring>: AGEOGRAPHYobject representing a closedLineStringthat forms the boundary of the polygon
Returns
Returns a GEOGRAPHY object of subtype ST_Polygon constructed from the input LineString.
Example
sql
SELECT ST_AsText(ST_POLYGON('LINESTRING(0 0, 0 1, 1 1, 1 0, 0 0)'::GEOGRAPHY));
-- POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))