Поделиться через


Метод SqlGeography.Reduce

Returns an approximation of the given geography instance produced by running the Douglas-Peucker algorithm on the instance with the given tolerance.

Пространство имен:  Microsoft.SqlServer.Types
Сборка:  Microsoft.SqlServer.Types (в Microsoft.SqlServer.Types.dll)

Синтаксис

'Декларация
<SqlMethodAttribute(IsDeterministic := True, IsPrecise := False)> _
Public Function Reduce ( _
    tolerance As Double _
) As SqlGeography
'Применение
Dim instance As SqlGeography 
Dim tolerance As Double 
Dim returnValue As SqlGeography 

returnValue = instance.Reduce(tolerance)
[SqlMethodAttribute(IsDeterministic = true, IsPrecise = false)]
public SqlGeography Reduce(
    double tolerance
)
[SqlMethodAttribute(IsDeterministic = true, IsPrecise = false)]
public:
SqlGeography^ Reduce(
    double tolerance
)
[<SqlMethodAttribute(IsDeterministic = true, IsPrecise = false)>]
member Reduce : 
        tolerance:float -> SqlGeography
public function Reduce(
    tolerance : double
) : SqlGeography

Параметры

  • tolerance
    Тип: System.Double
    Is a double that represents the tolerance to input to the Douglas-Peucker algorithm. tolerance must be a positive number.

Возвращаемое значение

Тип: Microsoft.SqlServer.Types.SqlGeography
A SqlGeography value representing an approximation of the current instance.

Замечания

For collection types, this algorithm operates independently on each SqlGeography contained in the instance. This algorithm does not modify Point instances.

This method will attempt to preserve the endpoints of LineString instances, but may fail to do so in order to preserve a valid result.

If Reduce is called with a negative value, this method will produce an ArgumentException. Tolerances used in Reduce must be positive numbers.

The Douglas-Peucker algorithm works on each curve or ring in the geography instance by removing all points except for the start point and end point. Each point removed is then added back, starting with the farthest outlying point, until no point is more than tolerance from the result. The result is then made valid if necessary, as a valid result is guaranteed.

This method is deterministic but not precise.

См. также

Справочник

SqlGeography Класс

Пространство имен Microsoft.SqlServer.Types