當輸入Geometry對象在判定條件ST_IsClosed下為true且ST_IsSimple也為true時,返回true。

語法

boolean  ST_IsRing(geometry  g);

參數

參數名稱 描述
g 目標Geometry對象。

示例

  • 返回true的情況:
    SELECT ST_IsRing(geom), ST_IsClosed(geom), ST_IsSimple(geom) FROM (SELECT 'LINESTRING(0 0,0 2,2 0,0 0)'::geometry AS geom) AS test;
     st_isring | st_isclosed | st_issimple
    -----------+-------------+-------------
     t         | t           | t
    (1 row)
                        
  • 返回false的情況:
    SELECT ST_IsRing(geom), ST_IsClosed(geom), ST_IsSimple(geom) FROM (SELECT 'LINESTRING(0 0,0 2,0 0)'::geometry AS geom) AS test;
     st_isring | st_isclosed | st_issimple
    -----------+-------------+-------------
     f         | t           | f
    (1 row)