判斷地理距離。
命名空間: System.Spatial
組件: System.Spatial (在 System.Spatial.dll 中)
語法
'宣告
<ExtensionAttribute> _
Public Shared Function Distance ( _
operand1 As Geography, _
operand2 As Geography _
) As Nullable(Of Double)
'用途
Dim operand1 As Geography
Dim operand2 As Geography
Dim returnValue As Nullable(Of Double)
returnValue = operand1.Distance(operand2)
public static Nullable<double> Distance(
this Geography operand1,
Geography operand2
)
[ExtensionAttribute]
public:
static Nullable<double> Distance(
Geography^ operand1,
Geography^ operand2
)
static member Distance :
operand1:Geography *
operand2:Geography -> Nullable<float>
public static function Distance(
operand1 : Geography,
operand2 : Geography
) : Nullable<double>
參數
- operand1
型別:System.Spatial.Geography
第一個運算元。
- operand2
型別:System.Spatial.Geography
第二個運算元。
傳回值
型別:System.Nullable<Double>
運算結果。
使用注意事項
在 Visual Basic 及 C# 中,您可以在任何型別 Geography 的物件上將這個方法做為執行個體方法呼叫。使用執行個體方法語法呼叫這個方法時,請省略第一個參數。如需詳細資訊,請參閱 https://msdn.microsoft.com/zh-tw/library/bb384936(v=vs.103) 或 https://msdn.microsoft.com/zh-tw/library/bb383977(v=vs.103)。