ST_DFullyWithin — 测试两个几何图形是否完全在给定距离内
boolean ST_DFullyWithin(
geometry g1, geometry g2, double precision distance)
;
如果两个几何图形完全在彼此的指定距离内,则返回 true。距离以几何图形的空间参考系统定义的单位指定。为了使此函数有意义,源几何图形必须都具有相同的坐标投影,具有相同的 SRID。
此函数会自动包含边界框比较,该比较会利用几何图形上可用的任何空间索引。 |
可用性:1.5.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 |