How does STBuffer measure distance around polygons?

Hayley 0 Reputation points
2023-02-20T00:36:39.1866667+00:00

Hiya,

How does the STBuffer function measure distances around a polygon?

I am looking at the expression: select SP_GEOMETRY.STBuffer(100) and wondering how the 100-meter buffer is calculated around the geometry of polygons.

e.g., is it from the centre of the polygon? or does the buffer start from the edges of the polygon?

I am struggling to find helpful documentation on this so if you have any links let me know!

Thanks heaps

SQL Server | Other
{count} votes

1 answer

Sort by: Most helpful
  1. Seeya Xi-MSFT 16,586 Reputation points
    2023-02-20T08:49:38.3666667+00:00

    Hi @Hayley ,

    The STBuffer function in SQL Server is used to generate a new geometry object that represents a buffer zone around the input geometry. The buffer zone is a region of a specified width around the input geometry. The width is specified in the units of the spatial reference system used by the geometry.

    In the case of a polygon input, the buffer is calculated based on the outer boundary of the polygon. The buffer distance is measured perpendicularly from the edges of the polygon, not from its center. The resulting buffer is a new polygon that encloses the original polygon and extends outward by the specified buffer distance.

    The buffer distance can be positive or negative. A positive buffer distance will expand the polygon outward, while a negative buffer distance will shrink the polygon inward. If the buffer distance is set to zero, the resulting polygon will be identical to the input polygon.

    The actual calculation of the buffer is performed using a spatial algorithm that takes into account the shape of the input polygon and the units of the spatial reference system. The specific algorithm used by STBuffer is not documented, but it is likely based on well-known computational geometry algorithms for buffering polygons, such as the Minkowski sum algorithm.

    Best regards,

    Seeya


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.