Condividi tramite


Metodo DbSpatialServices.Distance (DbGeometry, DbGeometry)

[Questa pagina è specifica della versione 6 di Entity Framework. La versione più recente è disponibile come pacchetto NuGet per "Entity Framework". Per ulteriori informazioni su Entity Framework, vedere la pagina msdn.com/data/ef.]

Calcola la distanza tra i punti più vicini in due valori DbGeometry.

Spazio dei nomi:  System.Data.Entity.Spatial
Assembly:  EntityFramework (in EntityFramework.dll)

Sintassi

'Dichiarazione
Public MustOverride Function Distance ( _
    geometryValue As DbGeometry, _
    otherGeometry As DbGeometry _
) As Double
'Utilizzo
Dim instance As DbSpatialServices 
Dim geometryValue As DbGeometry 
Dim otherGeometry As DbGeometry 
Dim returnValue As Double 

returnValue = instance.Distance(geometryValue, _
    otherGeometry)
public abstract double Distance(
    DbGeometry geometryValue,
    DbGeometry otherGeometry
)
public:
virtual double Distance(
    DbGeometry^ geometryValue, 
    DbGeometry^ otherGeometry
) abstract
abstract Distance : 
        geometryValue:DbGeometry * 
        otherGeometry:DbGeometry -> float
public abstract function Distance(
    geometryValue : DbGeometry, 
    otherGeometry : DbGeometry
) : double

Parametri

Valore restituito

Tipo: System.Double
Valore Double che specifica la distanza tra i due punti più vicini in geometryValue e otherGeometry.

Eccezioni

Eccezione Condizione
ArgumentNullException

geometryValue o otherGeometry è null.

ArgumentException

geometryValue o otherGeometry non è compatibile con l'implementazione spaziale dei servizi.

Vedere anche

Riferimento

DbSpatialServices Classe

Overload Distance

Spazio dei nomi System.Data.Entity.Spatial