名称

ST_3DDFullyWithin — 测试两个 3D 几何体是否完全在给定的 3D 距离内

语法

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

描述

如果 3D 几何体完全在彼此指定距离内,则返回 true。距离以几何体空间参考系统定义的单位指定。此函数要合理,源几何体必须具有相同的坐标投影,具有相同的 SRID。

[Note]

此函数自动包括边界框比较,该比较使用几何体上可用的任何空间索引。

可用性:2.0.0

此函数支持 3d,不会删除 z 索引。

此函数支持多面体表面。

示例

    -- This compares the difference between fully within and distance within as well
    -- as the distance fully within for the 2D footprint of the line/point vs. the 3d fully within
    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
    (select ST_GeomFromEWKT('POINT(1 1 2)') as geom_a,
    ST_GeomFromEWKT('LINESTRING(1 5 2, 2 7 20, 1 9 100, 14 12 3)') as geom_b) t1;
 d3dfullywithin10 | d3dwithin10 | d2dfullywithin20 | d3dfullywithin20
------------------+-------------+------------------+------------------
 f                | t           | t                | f 

另请参阅

ST_3DDWithinST_DWithinST_DFullyWithinST_3DMaxDistance