# ST_Disjoint

## 定义

ST_Disjoint 获取两个 ST_Geometries，如果两个几何的交集生成空集，则返回 1 (Oracle) 或 t (PostgreSQL)；否则返回 0 (Oracle) 或 f (PostgreSQL)。

## 语法

`sde.st_disjoint (g1 sde.st_geometry, g2 sde.st_geometry)`

## 示例

``````CREATE TABLE sensitive_areas (id integer,
zones sde.st_geometry);

CREATE TABLE hazardous_sites (id integer,
loc sde.st_geometry);

INSERT INTO sensitive_areas VALUES (
1,
sde.st_geometry ('polygon ((20 30, 30 30, 30 40, 20 40, 20 30))', 0)
);

INSERT INTO sensitive_areas VALUES (
2,
sde.st_geometry ('polygon ((30 30, 30 50, 50 50, 50 30, 30 30))', 0)
);

INSERT INTO sensitive_areas VALUES (
3,
sde.st_geometry ('polygon ((40 40, 40 60, 60 60, 60 40, 40 40))', 0)
);

INSERT INTO hazardous_sites VALUES (
4,
sde.st_geometry ('point (60 60)', 0)
);

INSERT INTO hazardous_sites VALUES (
5,
sde.st_geometry ('point (30 30)', 0)
);
``````

SELECT 语句列出在危险废弃物场地的缓冲区范围外的所有敏感区域。

Oracle

``````SELECT sa.id
FROM SENSITIVE_AREAS sa, HAZARDOUS_SITES hs
WHERE sde.st_disjoint ((sde.st_buffer (hs.loc, .1)), sa.zones) = 1
AND hs.id = 5;

ID

3
``````

PostgreSQL

``````SELECT sa.id
FROM sensitive_areas sa, hazardous_sites hs
WHERE sde.st_disjoint ((sde.st_buffer (hs.loc, .1)), sa.zones) = 't'
AND hs.id = 5;

id

3
``````

9/15/2013