SpatialEdmFunctions.Distance(DbExpression, DbExpression) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
创建一个使用指定参数调用规范“Distance”函数的函数 DbFunctionExpression ,每个参数都必须具有 Edm.Geography 或 Edm.Geometry 结果类型。 结果类型 spatialValue1 必须与结果类型 spatialValue2匹配。 表达式的结果类型为 Edm.Double。
public:
[System::Runtime::CompilerServices::Extension]
static System::Data::Common::CommandTrees::DbFunctionExpression ^ Distance(System::Data::Common::CommandTrees::DbExpression ^ spatialValue1, System::Data::Common::CommandTrees::DbExpression ^ spatialValue2);
public static System.Data.Common.CommandTrees.DbFunctionExpression Distance(this System.Data.Common.CommandTrees.DbExpression spatialValue1, System.Data.Common.CommandTrees.DbExpression spatialValue2);
static member Distance : System.Data.Common.CommandTrees.DbExpression * System.Data.Common.CommandTrees.DbExpression -> System.Data.Common.CommandTrees.DbFunctionExpression
<Extension()>
Public Function Distance (spatialValue1 As DbExpression, spatialValue2 As DbExpression) As DbFunctionExpression
参数
- spatialValue1
- DbExpression
一个指定第一个空间值的表达式。
- spatialValue2
- DbExpression
一个表达式,指定应从中测量距离 spatialValue1 的空间值。
返回
一个新的 DbFunctionExpression,返回最接近的点 spatialValue1 之间的 spatialValue1距离。
例外
spatialValue1
spatialValue2
spatialValue1
spatialValue2