Назва

ST_3DDFullyWithin — Перевіряє, чи дві 3D-геометрії повністю знаходяться в межах заданої 3D-відстані

Короткий огляд

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

Опис

Повертає значення true, якщо 3D-геометрії повністю знаходяться на заданій відстані одна від одної. Відстань задається в одиницях, визначених просторовою системою координат геометрій. Щоб ця функція мала сенс, вихідні геометрії повинні мати однакову проекцію координат і однаковий SRID.

[Примітка]

This function automatically includes a bounding box comparison that makes use of any spatial indexes that are available on the geometries.

Доступність: 2.0.0

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

This function supports Polyhedral surfaces.

Приклади

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.

Code
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 
Figure
Geometry figure for visual-st-3ddfullywithin-01