This topic describes the ST_3DDistance function. This function calculates the Euclidean distance between two 3D geometry objects in a projected coordinate system.

Syntax

float  ST_3DDistance(geometry  g1 , geometry  g2);

Parameters

Parameter Description
g1 The first geometry object that you want to specify.
g2 The second geometry object that you want to specify.

Description

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

Examples

SELECT ST_3DDistance('POINT(0 0 0)'::geometry,'POINT(1 1 1)'::geometry);
  st_3ddistance
------------------
 1.73205080756888
(1 row)