名前

ST_3DDWithin — 二つの3次元ジオメトリが与えらえれた3次元距離内にある場合にはTRUEを返します。

概要

boolean ST_3DDWithin(geometry g1, geometry g2, double precision distance_of_srid);

説明

ジオメトリ型について、二つのオブジェクト間の距離が、投影法の単位 (空間参照系の単位)でdistance_of_srid内にある場合にtrueを返します。

This function supports 3d and will not drop the z-index.

This function supports Polyhedral surfaces.

This method implements the SQL/MM specification. SQL-MM ?

Availability: 2.0.0

-- ジオメトリの例 - メートル単位(SRID: 2163 米国ナショナルアトラス正積図法)
-- (3次元ポイントとラインの距離と、2次元ポイントとラインの距離とを比較)
-- ご注意: 現在は垂直データムに対応していないので、
-- Zは変換されずに、最終的に同じであると仮定されます。
SELECT ST_3DDWithin(
                        ST_Transform(ST_GeomFromEWKT('SRID=4326;POINT(-72.1235 42.3521 4)'),2163),
                        ST_Transform(ST_GeomFromEWKT('SRID=4326;LINESTRING(-72.1260 42.45 15, -72.123 42.1546 20)'),2163),
                        126.8
                ) As within_dist_3d,
ST_DWithin(
                        ST_Transform(ST_GeomFromEWKT('SRID=4326;POINT(-72.1235 42.3521 4)'),2163),
                        ST_Transform(ST_GeomFromEWKT('SRID=4326;LINESTRING(-72.1260 42.45 15, -72.123 42.1546 20)'),2163),
                        126.8
                ) As within_dist_2d;

 within_dist_3d | within_dist_2d
----------------+----------------
 f              | t

関連情報

ST_3DDistance, ST_Distance, ST_DWithin, ST_3DMaxDistance, ST_Transform