Name

ST_DFullyWithin — 测试两个几何图形是否完全在给定距离内

Synopsis

boolean ST_DFullyWithin(geometry g1, geometry g2, double precision distance);

描述

如果几何图形彼此完全在指定距离内,则返回 true。 距离以几何空间参考系统定义的单位指定。 为了使此函数有意义,源几何图形必须具有相同的坐标投影,并具有相同的 SRID。

[Note]

此功能自动包括利用几何上可用的任何空间索引的边界框比较。

可用性:1.1.0

示例

postgis=# SELECT ST_DFullyWithin(geom_a, geom_b, 10) as DFullyWithin10, ST_DWithin(geom_a, geom_b, 10) as DWithin10, ST_DFullyWithin(geom_a, geom_b, 20) as DFullyWithin20 from
    (select ST_GeomFromText('POINT(1 1)') as geom_a,ST_GeomFromText('LINESTRING(1 5, 2 7, 1 9, 14 12)') as geom_b) t1;

-----------------
 DFullyWithin10 | DWithin10 | DFullyWithin20 |
---------------+----------+---------------+
 f             | t        | t             |