ST_Disjoint — 如果栅格 rastA 与 rastB 在空间上不相交,则返回 true。
boolean ST_Disjoint( raster rastA , integer nbandA , raster rastB , integer nbandB );
boolean ST_Disjoint( raster rastA , raster rastB );
如果栅格 rastA 和 rastB 不共享任何空间,则它们是不相交的。如果未提供波段编号(或设置为 NULL),则在测试中仅考虑栅格的凸包。如果提供了波段编号,则在测试中仅考虑具有值(非 NODATA)的像素。
| ![[Note]](../images/note.png)  | |
| 此函数不使用任何索引。 | 
| ![[Note]](../images/note.png)  | |
| 要测试栅格和几何体的空间关系,请在栅格上使用 ST_Polygon,例如 ST_Disjoint(ST_Polygon(栅格), 几何体)。 | 
可用性: 2.1.0
-- rid = 1 has no bands, hence the NOTICE and the NULL value for st_disjoint
SELECT r1.rid, r2.rid, ST_Disjoint(r1.rast, 1, r2.rast, 1) FROM dummy_rast r1 CROSS JOIN dummy_rast r2 WHERE r1.rid = 2;
NOTICE:  The second raster provided has no bands
 rid | rid | st_disjoint
-----+-----+-------------
   2 |   1 |
   2 |   2 | f
            
        -- this time, without specifying band numbers
SELECT r1.rid, r2.rid, ST_Disjoint(r1.rast, r2.rast) FROM dummy_rast r1 CROSS JOIN dummy_rast r2 WHERE r1.rid = 2;
 rid | rid | st_disjoint
-----+-----+-------------
   2 |   1 | t
   2 |   2 | f