Name

ST_CoveredBy — 如果A中没有点在B之外,则返回TRUE

Synopsis

boolean ST_CoveredBy(geometry geomA, geometry geomB);

boolean ST_CoveredBy(geography geogA, geography geogB);

描述

退货 true 如果几何图形/地理图形A中没有点位于几何图形/地理图形B的外部,则测试几何图形A的每个点是否都在几何图形B的内部(即,与几何图形B的内部或边界相交)。

[Note]

This function automatically includes a bounding box comparison that makes use of any spatial indexes that are available on the geometries. 要避免使用索引,请使用函数 _ST_CoveredBy

[Important]

增强:已启用3.0.0支持 GEOMETRYCOLLECTION

[Important]

请勿对无效的几何图形使用此函数。你会得到意想不到的结果。

由GEOS模块执行

可用性:1.2.2

注意:这是“允许的”版本,返回布尔值,而不是整数。

不是OGC标准,但甲骨文也有。

示例

--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