BufferWithTolerance (geometry)

BufferWithTolerance (geometry)#

Returns a geometric object that represents the union of all point values whose distance from a geometry instance is less than or equal to a specified value, allowing for a specified tolerance.

Syntax#

.BufferWithTolerance ( distance, tolerance, relative )

Arguments#

distance

Is a float expression specifying the distance from the geometry instance around which to calculate the buffer.

tolerance

Is a float expression specifying the tolerance of the buffer distance.

Tolerance refers to the maximum variation in the ideal buffer distance for the returned linear approximation.

For example, the ideal buffer distance of a point is a circle, but this must be approximated by a polygon. The smaller the tolerance, the more points the polygon will have, which increases the complexity of the result, but decreases the error.

relative

Is a bit specifying whether the tolerance value is relative or absolute. If ‘TRUE’ or 1, then tolerance is relative and is calculated as the product of the tolerance parameter and the diameter of the bounding box of the instance. If ‘FALSE’ or 0, tolerance is absolute and the tolerance value is the absolute maximum variation in the ideal buffer distance for the returned linear approximation.

Return type#

geometry

Exceptions#

The tolerance parameter must be greater than zero. If tolerance <= 0 then an ArgumentOutOfRangeException is thrown.

Example#

Create a Point instance and use BufferWithTolerance() to obtain a rough buffer around it.

DECLARE @g geometry;
SET @g = geometry::STGeomFromText('POINT(3 3)', 0);
SELECT @g.BufferWithTolerance(1, .5, 0).ToString();

See Also#