Skip to content
πŸŽ‰ SedonaDB 0.4.0 is out now! πŸ—ΊοΈ Python DataFrame API, R dplyr, Geography support & GPU-accelerated spatial joins. Read the release blog β†’

ST_Polygon

Introduction: Function to create a polygon built from the given LineString and sets the spatial reference system from the srid

ST_Polygon

Format: ST_Polygon(geom: Geometry, srid: Integer)

Return type: Geometry

SQL Example:

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

Output:

POLYGON((75 29 1, 77 29 2, 77 29 3, 75 29 1))