次の方法で共有


SqlGeography.STDistance メソッド

任意の SqlGeography インスタンスの地点と別の SqlGeography インスタンスの地点との最短距離を返します。

名前空間:  Microsoft.SqlServer.Types
アセンブリ:  Microsoft.SqlServer.Types (Microsoft.SqlServer.Types.dll)

構文

'宣言
<SqlMethodAttribute(IsDeterministic := True, IsPrecise := False)> _
Public Function STDistance ( _
    other As SqlGeography _
) As SqlDouble
'使用
Dim instance As SqlGeography 
Dim other As SqlGeography 
Dim returnValue As SqlDouble 

returnValue = instance.STDistance(other)
[SqlMethodAttribute(IsDeterministic = true, IsPrecise = false)]
public SqlDouble STDistance(
    SqlGeography other
)
[SqlMethodAttribute(IsDeterministic = true, IsPrecise = false)]
public:
SqlDouble STDistance(
    SqlGeography^ other
)
[<SqlMethodAttribute(IsDeterministic = true, IsPrecise = false)>]
member STDistance : 
        other:SqlGeography -> SqlDouble
public function STDistance(
    other : SqlGeography
) : SqlDouble

パラメーター

  • other
    型: Microsoft.SqlServer.Types.SqlGeography
    STDistance を呼び出したインスタンスまでの距離が測定される、別の geography インスタンスです。 空のセットを指定すると、STDistance は null を返します。

戻り値

型: System.Data.SqlTypes.SqlDouble
2 つの SqlGeography インスタンスの SRID (spatial reference ID) が一致しない場合は null を返します。このメソッドが対蹠点 (つまり、地球上で正反対の地点) 間の距離の測定に使われる場合は、POINT (0 0) と POINT (180 0) の間の距離の場合と同様に、このメソッドは null を返します。

関連項目

参照

SqlGeography クラス

Microsoft.SqlServer.Types 名前空間