제목

ST_Polygon — Creates a Polygon from a LineString with a specified SRID.

요약

geometry ST_Polygon(geometry lineString, integer srid);

설명

Returns a polygon built from the given LineString and sets the spatial reference system from the srid.

ST_Polygon is similar to ST_MakePolygon Variant 1 with the addition of setting the SRID.

, ST_MakePoint, ST_SetSRID

[참고]

이 함수에 멀티라인스트링을 입력할 수는 없습니다. 라인스트링을 생성하려면 ST_LineMerge 또는 ST_Dump 를 이용하십시오.

This method implements the OGC Simple Features Implementation Specification for SQL 1.1.

This method implements the SQL/MM specification. SQL-MM 3: 8.3.2

This function supports 3d and will not drop the z-index.

예시

Create a 2D polygon.

Code
SELECT ST_Polygon('LINESTRING(75 29,77 29,77 31,75 31,75 29)'::geometry, 4326);
래스터 출력
POLYGON((75 29,77 29,77 31,75 31,75 29))
Figure
Geometry figure for visual-st-polygon-01

Create a 3D polygon.

Code
SELECT ST_Polygon('LINESTRING(75 29 1,77 29 2,77 31 2,75 31 1,75 29 1)'::geometry, 4326);
래스터 출력
SRID=4326;POLYGON((75 29 1,77 29 2,77 31 2,75 31 1,75 29 1))
Figure
Geometry figure for visual-st-polygon-02