DbSpatialServices.Distance Method

 

Computes the distance between the closest points in two specified values.

Namespace:   System.Data.Entity.Spatial
Assembly:  EntityFramework (in EntityFramework.dll)

NameDescription
System_CAPS_pubmethodDistance(DbGeography, DbGeography)

Computes the distance between the closest points in two DbGeography values.

System_CAPS_pubmethodDistance(DbGeometry, DbGeometry)

Computes the distance between the closest points in two DbGeometry values.


DbSpatialServices.Distance Method (DbGeography, DbGeography)

Computes the distance between the closest points in two DbGeography values.

public abstract double Distance(
	DbGeography geographyValue,
	DbGeography otherGeography
)

Parameters

geographyValue
Type: System.Data.Entity.Spatial.DbGeography

The first geography value.

otherGeography
Type: System.Data.Entity.Spatial.DbGeography

The second geography value.

Return Value

Type: System.Double

A double value that specifies the distance between the two closest points in geographyValue and otherGeography.

Exception Condition
ArgumentNullException

geographyValue or otherGeography is null.

ArgumentException

geographyValue or otherGeography is not compatible with this spatial services implementation.


DbSpatialServices.Distance Method (DbGeometry, DbGeometry)

Computes the distance between the closest points in two DbGeometry values.

public abstract double Distance(
	DbGeometry geometryValue,
	DbGeometry otherGeometry
)

Parameters

geometryValue
Type: System.Data.Entity.Spatial.DbGeometry

The first geometry value.

otherGeometry
Type: System.Data.Entity.Spatial.DbGeometry

The second geometry value.

Return Value

Type: System.Double

A double value that specifies the distance between the two closest points in geometryValue and otherGeometry.

Exception Condition
ArgumentNullException

geometryValue or otherGeometry is null.

ArgumentException

geometryValue or otherGeometry is not compatible with this spatial services implementation.