ST_DISTANCE

functionsupportedCore SQL functions

docs.snowflake.com ↗

Geospatial functions

Returns the minimum great circle distance between two GEOGRAPHY or the minimum Euclidean distance between two GEOMETRY objects.

Syntax

ST_DISTANCE( <geography_or_geometry_expression_1> , <geography_or_geometry_expression_2> )

Parameters

NameRequiredDescription
geography_or_geometry_expression_1requiredThe argument must be of type GEOGRAPHY or GEOMETRY.
geography_or_geometry_expression_2requiredThe argument must be of type GEOGRAPHY or GEOMETRY.

Returns

Returns a FLOAT value, which represents the distance, or NULL: - For GEOGRAPHY input values, the distance is in meters. - For GEOMETRY input values, the distance is computed with the same units used to define the input coordinates. - Returns NULL if one or more input points are NULL.

Usage notes