名稱

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