Returns true if the 3D distance between two geometry objects does not exceed the specified threshold. The distance is measured in a projected coordinate system.
Syntax
boolean ST_3DDWithin(geometry g1, geometry g2, double precision distanceOfSrid);Parameters
| Parameter | Type | Description |
|---|---|---|
g1 | geometry | The first geometry object. |
g2 | geometry | The second geometry object. |
distanceOfSrid | double precision | The maximum distance, measured in the unit defined by the spatial reference system (SRS) of the geometry objects. |
Usage notes
Supports 3D objects and preserves Z coordinates.
Supports polyhedral surfaces.
Examples
Basic usage
Check whether two 3D points are within a distance of 2:
SELECT ST_3DDWithin(
'POINT(0 0 0)'::geometry,
'POINT(1 1 1)'::geometry,
2
);Output:
st_3ddwithin
--------------
t
(1 row)