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 given geometry by the specified distance, measured in the given unit.
Each point on the boundary of the resulting geometry is the specified distance away from the given geometry. The resulting geometry is represented in the spatial reference system of the given 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 given geometry is null or is empty, null will be returned.
This function can also be called as a method.
Syntax
Parameter
- geometry
- A value of type ST_Geometry or one of its subtypes that represents the geometry to create the buffer around.For geodetic data, ST_Buffer supports only ST_Point and ST_MultiPoint data types.
- distance
- A DOUBLE PRECISION value that specifies the distance to be used for the buffer around geometry. For geodetic data, the distance must not be greater than the Earth's equatorial radius. For the WGS-84 ellipsoid, this length is 6378137.0 meters.
- unit
- A VARCHAR(128) value that identifies the unit in which distance is measured. The supported units of measure are listed in the DB2GSE.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 8.
- 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, but is not in a geodetic spatial reference system (SRS), the angular unit associated with this coordinate system is the default.
- If geometry is in a geodetic SRS, the default unit of measure is meters.
- 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 or not in a geodetic SRS, and a linear unit is specified.
- The geometry is in a geographic coordinate system, is in a geodetic SRS, and an angular unit is specified.
Return type
db2gse.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.
