语言

SqlGeography.STDistance(SqlGeography) 方法

定义

返回实例中 SqlGeography 某个点与另一 SqlGeography 个实例中的点之间的最短距离。

[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

参数

other
SqlGeography

另一个地理实例,从中测量调用的 STDistance(SqlGeography) 实例之间的距离。 如果指定了空集, STDistance(SqlGeography) 将返回 null。

返回

如果实例的空间引用 ID(SRID) SqlGeography 不匹配,则返回 null。如果此方法用于确定反双脚点之间的距离,或地球对面的连续点之间的距离,如 POINT (0 0) 和 POINT (180 0 之间的距离),此方法将返回 null。

属性

适用于