ST_3DDFullyWithin — 测试两个 3D 几何图形是否完全在给定的 3D 距离内
boolean ST_3DDFullyWithin(geometry g1, geometry g2, double precision distance);
如果 3D 几何图形彼此完全在指定距离内,则返回 true。 距离以几何空间参考系统定义的单位指定。 为了使此函数有意义,源几何图形必须具有相同的坐标投影,并具有相同的 SRID。
|
|
|
此功能自动包括利用几何上可用的任何空间索引的边界框比较。 |
可用性: 2.0.0
该函数支持 3d 并且不会丢失 z-index。
该函数支持多面体曲面。
This example compares distance-within predicates in 2D and 3D. The point is distance-within the line in 3D, but the full 3D line is not within the same distance of the point.
WITH data AS (
SELECT
'POINT(1 1 2)'::geometry AS geom_a,
'LINESTRING(1 5 2,2 7 20,1 9 100,14 12 3)'::geometry AS geom_b
)
SELECT
ST_3DDFullyWithin(geom_a, geom_b, 10) AS d3dfullywithin10,
ST_3DDWithin(geom_a, geom_b, 10) AS d3dwithin10,
ST_DFullyWithin(geom_a, geom_b, 20) AS d2dfullywithin20,
ST_3DDFullyWithin(geom_a, geom_b, 20) AS d3dfullywithin20
FROM data;
d3dfullywithin10 | d3dwithin10 | d2dfullywithin20 | d3dfullywithin20 ------------------+-------------+------------------+------------------ f | t | t | f