Skip to main content
Returns the minimum distance between two supported values. Point-to-line distance is measured to the closest point on any segment, including a segment interior and endpoints. For GEOGRAPHY, the function evaluates spherical OGC:CRS84 edges and returns meters. For GEOMETRY, it evaluates planar edges and returns the units of the declared CRS. GEOMETRY inputs must have compatible descriptors. This function does not perform CRS transformation.

Syntax

Parameters

The supported family pairs are:
  • POINT with POINT
  • POINT with LINESTRING or MULTILINESTRING, in either argument order
All values must be two-dimensional. An exact or numerically ambiguous antipodal segment in a GEOGRAPHY line is rejected because it does not define a unique shortest spherical edge.

Return value

Returns NULL if either input is NULL or EMPTY. Unsupported families or descriptors, mixed GEOGRAPHY/GEOMETRY values, and incompatible GEOMETRY descriptors produce an error.

Examples

keyword

ST_DISTANCE,ST,DISTANCE,GEOGRAPHY,GEOMETRY GEOGRAPHY, GEOMETRY, DOUBLE