Click to Rate and Give Feedback
MSDN
MSDN Library
SQL Server
SQL Server 2008
Database Engine
Technical Reference
 Reduce (geometry Data Type)

  Switch on low bandwidth view
Community Content
In this section
Statistics Annotations (0)
SQL Server 2008 Books Online (June 2009)
Reduce (geometry Data Type)

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

.Reduce ( tolerance )
tolerance

Is a value of type float. tolerance is the tolerance to input to the Douglas-Peucker algorithm.

SQL Server return type: geometry

CLR return type: SqlGeometry

For collection types, this algorithm operates independently on each geometry contained in the instance.

This algorithm does not modify Point instances.

On LineString instances, the Douglas-Peucker algorithm retains the original start and end points of the instance, and iteratively adds back the point from the original instance that most deviates from the result until no point deviates more than the given tolerance.

On Polygon instances, the Douglas-Peucker algorithm is applied independently to each ring. The method will produce a FormatException if the returned Polygon instance is not valid; for example, an invalid MultiPolygon instance is created if Reduce() is applied to simplify each ring in the instance and the resulting rings overlap.

The following example creates a LineString instance and uses Reduce() to simplify the instance.

DECLARE @g geometry;
SET @g = geometry::STGeomFromText('LINESTRING(0 0, 0 1, 1 0, 2 1, 3 0, 4 1)', 0);
SELECT @g.Reduce(.75).ToString();
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker