Metodo DbSpatialServices.Distance (DbGeography, DbGeography)
[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 DbGeography.
Spazio dei nomi: System.Data.Entity.Spatial
Assembly: EntityFramework (in EntityFramework.dll)
Sintassi
'Dichiarazione
Public MustOverride Function Distance ( _
geographyValue As DbGeography, _
otherGeography As DbGeography _
) As Double
'Utilizzo
Dim instance As DbSpatialServices
Dim geographyValue As DbGeography
Dim otherGeography As DbGeography
Dim returnValue As Double
returnValue = instance.Distance(geographyValue, _
otherGeography)
public abstract double Distance(
DbGeography geographyValue,
DbGeography otherGeography
)
public:
virtual double Distance(
DbGeography^ geographyValue,
DbGeography^ otherGeography
) abstract
abstract Distance :
geographyValue:DbGeography *
otherGeography:DbGeography -> float
public abstract function Distance(
geographyValue : DbGeography,
otherGeography : DbGeography
) : double
Parametri
- geographyValue
Tipo: System.Data.Entity.Spatial.DbGeography
Primo valore geografico.
- otherGeography
Tipo: System.Data.Entity.Spatial.DbGeography
Secondo valore geografico.
Valore restituito
Tipo: System.Double
Valore Double che specifica la distanza tra i due punti più vicini in geographyValue e otherGeography.
Eccezioni
Eccezione | Condizione |
---|---|
ArgumentNullException | geographyValue o otherGeography è null. |
ArgumentException | geographyValue o otherGeography non è compatibile con l'implementazione spaziale dei servizi. |