SqlGeography.STDistance 方法 (SqlGeography)

 

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

命名空间:   Microsoft.SqlServer.Types
程序集:  Microsoft.SqlServer.Types(位于 Microsoft.SqlServer.Types.dll)

语法

[SqlMethodAttribute(IsDeterministic = true, IsPrecise = false)]
public SqlDouble STDistance(
    SqlGeography other
)
public:
[SqlMethodAttribute(IsDeterministic = true, IsPrecise = false)]
SqlDouble STDistance(
    SqlGeography^ other
)
[<SqlMethodAttribute(IsDeterministic = true, IsPrecise = false)>]
member STDistance : 
        other:SqlGeography -> SqlDouble
<SqlMethodAttribute(IsDeterministic := True, IsPrecise := False)>
Public Function STDistance (
    other As SqlGeography
) As SqlDouble

参数

  • other
    Type: Microsoft.SqlServer.Types.SqlGeography

    另一个地域实例,将度量该实例与调用了 STDistance 的实例之间的距离。 如果指定了空集,则 STDistance 将返回 Null。

返回值

Type: System.Data.SqlTypes.SqlDouble

如果 SqlGeography 实例的空间引用 ID (SRID) 不匹配,则返回 Null。

如果此方法用于确定球体另一面上对跖点或连续点之间的距离(如 POINT (0 0) 和 POINT (180 0) 之间的距离),则此方法将返回 Null。

另请参阅

SqlGeography 类
Microsoft.SqlServer.Types 命名空间

返回页首