Skip to main content
Function to create a polygon built from the given LineString and sets the spatial reference system from the srid ST_Polygon

Signatures

ST_Polygon(geom: Geometry, srid: Integer)

Parameters

geom
Geometry
required
The input geometry.
srid
Integer
required
Spatial Reference Identifier.

Return type

The resulting geometry.

Example

SELECT ST_AsText( ST_Polygon(ST_GeomFromEWKT('LINESTRING(75 29 1, 77 29 2, 77 29 3, 75 29 1)'), 4326) );
POLYGON((75 29 1, 77 29 2, 77 29 3, 75 29 1))