This topic describes the ST_3DDWithin function. This function checks whether the 3D distance between two geometry objects in a projected coordinate system does not exceed the value of the distanceOfSrid parameter. If the 3D distance does not exceed the value of the distanceOfSrid parameter, this function returns True. If the 3D distance exceeds the value of the distanceOfSrid parameter, this function returns False.

Syntax

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

Parameters

Parameter Description
g1 The first geometry object that you want to specify.
g2 The second geometry object that you want to specify.
distanceOfSrid The distance limit that you want to specify. The distance is measured in the unit that is specified by the spatial reference system of the geometry objects.

Description

  • This function supports 3D objects and does not delete z coordinates.
  • This function supports polyhedral surfaces.

Examples

SELECT ST_3DDWithin('POINT(0 0 0)'::geometry,'POINT(1 1 1)'::geometry,2);
 st_3ddwithin
--------------
 t
(1 row)