Compartir a través de


SqlGeography.STDistance Método

Returns the shortest distance between a point in a SqlGeography instance and a point in another SqlGeography instance.

Espacio de nombres:  Microsoft.SqlServer.Types
Ensamblado:  Microsoft.SqlServer.Types (en Microsoft.SqlServer.Types.dll)

Sintaxis

'Declaración
<SqlMethodAttribute(IsDeterministic := True, IsPrecise := False)> _
Public Function STDistance ( _
    other As SqlGeography _
) As SqlDouble
'Uso
Dim instance As SqlGeography 
Dim other As SqlGeography 
Dim returnValue As SqlDouble 

returnValue = instance.STDistance(other)
[SqlMethodAttribute(IsDeterministic = true, IsPrecise = false)]
public SqlDouble STDistance(
    SqlGeography other
)
[SqlMethodAttribute(IsDeterministic = true, IsPrecise = false)]
public:
SqlDouble STDistance(
    SqlGeography^ other
)
[<SqlMethodAttribute(IsDeterministic = true, IsPrecise = false)>]
member STDistance : 
        other:SqlGeography -> SqlDouble
public function STDistance(
    other : SqlGeography
) : SqlDouble

Parámetros

  • other
    Tipo: Microsoft.SqlServer.Types.SqlGeography
    Is another geography instance from which to measure the distance between the instance on which STDistance is invoked. If an empty set is specified, STDistance will return null.

Valor devuelto

Tipo: System.Data.SqlTypes.SqlDouble
Returns null if the spatial reference IDs (SRIDs) of the SqlGeography instances do not match.If this method is used to determine distance between antipodal points, or consecutive points on opposite sides of the globe, as in the distance between POINT (0 0) and POINT (180 0), this method will return null.

Vea también

Referencia

SqlGeography Clase

Espacio de nombres Microsoft.SqlServer.Types