名前

ST_IsRing — LINESTRINGが閉じていて、かつ単純である場合にTRUEを返します。

概要

boolean ST_IsRing(geometry g);

説明

LINESTRINGST_IsClosed (ST_StartPoint(g) ~= ST_Endpoint(g))で、かつST_IsSimple(自己インタセクションが無い)場合にTRUEを返します。

このメソッドはOpenGIS Simple Features Implementation Specification for SQL 1.1.に準拠しています。 2.1.5.1

このメソッドはSQL/MM仕様に準拠しています。 SQL-MM 3: 7.1.6

[注記]

SQL-MMでは、ST_IsRing(NULL)は0を返しますが、PostGISではNULLを返します。

SELECT ST_IsRing(the_geom), ST_IsClosed(the_geom), ST_IsSimple(the_geom)
FROM (SELECT 'LINESTRING(0 0, 0 1, 1 1, 1 0, 0 0)'::geometry AS the_geom) AS foo;
 st_isring | st_isclosed | st_issimple
-----------+-------------+-------------
 t         | t           | t
(1 row)

SELECT ST_IsRing(the_geom), ST_IsClosed(the_geom), ST_IsSimple(the_geom)
FROM (SELECT 'LINESTRING(0 0, 0 1, 1 0, 1 1, 0 0)'::geometry AS the_geom) AS foo;
 st_isring | st_isclosed | st_issimple
-----------+-------------+-------------
 f         | t           | f
(1 row)

関連情報

ST_IsClosed, ST_IsSimple, ST_StartPoint, ST_EndPoint