ST_ExteriorRing — 폴리곤 도형의 내곽 고리의 개수를 반환합니다.
geometry ST_ExteriorRing(geometry a_polygon);
POLYGON 도형의 외곽 고리(exterior ring)를 표현하는 라인스트링을 반환합니다. 도형이 폴리곤이 아닌 경우 NULL을 반환합니다.
![]() | |
이 함수는 멀티폴리곤을 입력받지 못 합니다. 멀티폴리곤의 경우 ST_Dump 함수와 결합해서 이용하십시오. |
This method implements the OGC Simple Features Implementation Specification for SQL 1.1.
2.1.5.1
This method implements the SQL/MM specification.
SQL-MM 3: 8.2.3, 8.3.3
This function supports 3d and will not drop the z-index.
--If you have a table of polygons
SELECT gid, ST_ExteriorRing(geom) AS ering
FROM sometable;
--If you have a table of MULTIPOLYGONs
--and want to return a MULTILINESTRING composed of the exterior rings of each polygon
SELECT gid, ST_Collect(ST_ExteriorRing(geom)) AS erings
FROM (SELECT gid, (ST_Dump(geom)).geom As geom
FROM sometable) As foo
GROUP BY gid;
--3d Example
SELECT ST_AsEWKT(
ST_ExteriorRing(
ST_GeomFromEWKT('POLYGON((0 0 1, 1 1 1, 1 2 1, 1 1 1, 0 0 1))')
)
);
st_asewkt
---------
LINESTRING(0 0 1,1 1 1,1 2 1,1 1 1,0 0 1)