共用方式為


DbSpatialServices.Distance 方法

定義

多載

Distance(DbGeography, DbGeography)

計算兩個 DbGeography 值中最接近點之間的距離。

Distance(DbGeometry, DbGeometry)

計算兩個 DbGeometry 值中最接近點之間的距離。

Distance(DbGeography, DbGeography)

計算兩個 DbGeography 值中最接近點之間的距離。

public abstract double Distance(System.Data.Entity.Spatial.DbGeography geographyValue, System.Data.Entity.Spatial.DbGeography otherGeography);
abstract member Distance : System.Data.Entity.Spatial.DbGeography * System.Data.Entity.Spatial.DbGeography -> double
Public MustOverride Function Distance (geographyValue As DbGeography, otherGeography As DbGeography) As Double

參數

geographyValue
DbGeography

第一個地理位置值。

otherGeography
DbGeography

第二個地理位置值。

傳回

double 值,指定 geographyValue 和其他Geography 中兩個最接近點之間的距離。

例外狀況

geographyValueotherGeography 為 null。

geographyValueotherGeography 與這個空間服務實作不相容。

適用於

Distance(DbGeometry, DbGeometry)

計算兩個 DbGeometry 值中最接近點之間的距離。

public abstract double Distance(System.Data.Entity.Spatial.DbGeometry geometryValue, System.Data.Entity.Spatial.DbGeometry otherGeometry);
abstract member Distance : System.Data.Entity.Spatial.DbGeometry * System.Data.Entity.Spatial.DbGeometry -> double
Public MustOverride Function Distance (geometryValue As DbGeometry, otherGeometry As DbGeometry) As Double

參數

geometryValue
DbGeometry

第一個幾何值。

otherGeometry
DbGeometry

第二個幾何值。

傳回

雙精度浮點數,指定 geometryValue 中兩個最接近點與其他Geometry 之間的距離。

例外狀況

geometryValueotherGeometry 為 null。

geometryValueotherGeometry 與這個空間服務實作不相容。

適用於