SqlGeography.STDistance(SqlGeography) Method

Definition

Returns the shortest distance between a point in a SqlGeography instance and a point in another SqlGeography instance.

[Microsoft.SqlServer.Server.SqlMethod(IsDeterministic=true, IsPrecise=false)]
public System.Data.SqlTypes.SqlDouble STDistance (Microsoft.SqlServer.Types.SqlGeography other);
[<Microsoft.SqlServer.Server.SqlMethod(IsDeterministic=true, IsPrecise=false)>]
member this.STDistance : Microsoft.SqlServer.Types.SqlGeography -> System.Data.SqlTypes.SqlDouble
Public Function STDistance (other As SqlGeography) As SqlDouble

Parameters

other
SqlGeography

Is another geography instance from which to measure the distance between the instance on which STDistance(SqlGeography) is invoked. If an empty set is specified, STDistance(SqlGeography) will return null.

Returns

Returns null if the spatial reference IDs (SRIDs) of the SqlGeography instances do not match.If this method is used to determine distance between antipodal points, or consecutive points on opposite sides of the globe, as in the distance between POINT (0 0) and POINT (180 0), this method will return null.

Attributes

Applies to