All Products
Search
Document Center

ApsaraDB RDS:ST_3DMaxDistance

Last Updated:Mar 28, 2026

Returns the maximum 3D Euclidean distance between two geometry objects.

Syntax

float ST_3DMaxDistance(geometry g1, geometry g2)

Parameters

ParameterDescription
g1The first geometry object.
g2The second geometry object.

Description

  • Returns the farthest (maximum) Euclidean distance between the two geometry objects, measured in the unit of their projected coordinate system.

  • Supports polyhedral surfaces.

  • Preserves z coordinates — the function operates fully in 3D space and does not drop z values.

Examples

SELECT ST_3DMaxDistance('POINT(0 0 0)'::geometry,'LINESTRING(0 0 1,1 1 0)'::geometry);
 st_3dmaxdistance
------------------
  1.4142135623731
(1 row)