名前

ST_CoveredBy — ジオメトリ/ジオグラフィAの点がジオメトリ/ジオグラフィBの外に無い場合に,1(TRUE)を返します.

概要

boolean ST_CoveredBy(geometry geomA, geometry geomB);

boolean ST_CoveredBy(geography geogA, geography geogB);

説明

ジオメトリ/ジオグラフィAの点がジオメトリ/ジオグラフィBの外に無い場合に,1(TRUE)を返します.

GEOSモジュールで実現しています.

[重要項目]

GEOMETRYCOLLECTIONを引数にして呼ばないでください.

[重要項目]

この関数を不正なジオメトリで呼ばないでください.予期しない結果が返されます.

初出バージョン: 1.2.2 - GEOS >= 3.0が必要です.

この関数は,ジオメトリ上で使用可能なインデクスを使うバウンディングボックス比較を自動的に取り込みます. インデクスの使用を避けるには,_ST_CoverdBy関数を使います.

ご注意: これは論理値を返して整数を返さないのが「許される」版です.

Not an OGC standard, but Oracle has it too.

直感的に分かりにくいST_ContainsとST_Withinの微妙な違いがあります.詳細については,Subtleties of OGC Covers, Contains, Withinをご覧ください.

	--a circle coveredby a circle
SELECT ST_CoveredBy(smallc,smallc) As smallinsmall,
	ST_CoveredBy(smallc, bigc) As smallcoveredbybig,
	ST_CoveredBy(ST_ExteriorRing(bigc), bigc) As exteriorcoveredbybig,
	ST_Within(ST_ExteriorRing(bigc),bigc) As exeriorwithinbig
FROM (SELECT ST_Buffer(ST_GeomFromText('POINT(1 2)'), 10) As smallc,
	ST_Buffer(ST_GeomFromText('POINT(1 2)'), 20) As bigc) As foo;
	--Result
 smallinsmall | smallcoveredbybig | exteriorcoveredbybig | exeriorwithinbig
--------------+-------------------+----------------------+------------------
 t            | t                 | t                    | f
(1 row)	

関連情報

ST_Contains, ST_Covers, ST_ExteriorRing, ST_Within