ST_Buffer function
The ST_Buffer function takes a geometry, a distance, and, optionally, a unit or a segment as input parameters and returns the geometry that surrounds the specified geometry by the specified distance, measured in the specified unit.
Each point on the boundary of the resulting geometry is the specified distance away from the specified geometry. The resulting geometry is represented in the spatial reference system of the specified geometry.
Any circular curve in the boundary of the resulting geometry is approximated by linear strings. For example, the buffer around a point, which would result in a circular region, is approximated by a polygon whose boundary is a linestring.
If the specified geometry is null or is empty, null will be returned.
>Syntax
Parameter
- geometry
- A value of type ST_Geometry or one of its subtypes that represents the geometry to create the buffer around.
- distance
- A DOUBLE PRECISION value that specifies the distance to be used for the buffer around geometry.
- unit
- A VARCHAR(128) value that identifies the unit in which distance is measured. The supported units of measure are listed in the SYSGEO.ST_UNITS_OF_MEASURE catalog view.
- segments
- An INTEGER value that identifies how many polygon edges are to be used in approximating a quarter circle. The default is 96.
- If geometry is in a projected or geocentric coordinate system, the linear unit associated with this coordinate system is the default.
- If geometry is in a geographic coordinate system, the angular unit associated with this coordinate system is the default.
- The geometry is in an unspecified coordinate system and the unit parameter is specified.
- The geometry is in a projected coordinate system and an angular unit is specified.
- The geometry is in a geographic coordinate system, but is not an ST_Point value, and a linear unit is specified.
Return type
ST_Geometry
Examples
In the following examples, the results have been reformatted for readability. The spacing in your results will vary according to your display.