ST_IsRing — 检测线串是闭合的还是简单的。
boolean ST_IsRing(
geometry g)
;
返回 TRUE
,当LINESTRING
同时满足 ST_IsClosed(即 ST_StartPoint(g) ~= ST_Endpoint(g)
)和 ST_IsSimple(即不自交)时。
此方法实现了 SQL 1.1 的 OGC 简单功能规范。 2.1.5.1
该方法实现了SQL/MM规范。 SQL-MM 3: 7.1.6
SQL-MM 定义了 |
SELECT ST_IsRing(geom), ST_IsClosed(geom), ST_IsSimple(geom) FROM (SELECT 'LINESTRING(0 0, 0 1, 1 1, 1 0, 0 0)'::geometry AS geom) AS foo; st_isring | st_isclosed | st_issimple -----------+-------------+------------- t | t | t (1 row) SELECT ST_IsRing(geom), ST_IsClosed(geom), ST_IsSimple(geom) FROM (SELECT 'LINESTRING(0 0, 0 1, 1 0, 1 1, 0 0)'::geometry AS geom) AS foo; st_isring | st_isclosed | st_issimple -----------+-------------+------------- f | t | f (1 row)