ST_IsRing

当输入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)