- Categories:
ST_ BUFFER¶
Returns a GEOMETRY object that represents a MultiPolygon containing the points within a specified distance of the input GEOMETRY object. The returned object effectively represents a “buffer” around the input object.
您还可以通过指定负的距离值来“缩小”输入对象。
语法
实参
geometry_expression实参必须是 GEOMETRY 类型的表达式。
distance与 GEOMETRY 对象的距离。要“缩小”对象,可以指定负的距离值。
The units depend on the spatial reference system identifier (SRID) of the GEOMETRY object. For example, ESPG:4326 (https://epsg.io/4326) units are degrees, while ESPG:25855 (https://epsg.io/25833) units are meters.
返回
返回一个 GEOMETRY 对象。
使用说明
- SRIDs are based on the EPSG standard (https://epsg.org/home.html) (v10.082). For example, the SRID 4326 corresponds to the authority EPSG with the code 4326.
- ST_BUFFER 使用八个段来模拟四分之一圆。
- If
distanceis a negative value, the returned object is smaller than the input object. You can use this to remove small irregularities from the shape. - 对于 LineStrings,端盖和联接样式始终是圆形。
- LineStrings 始终在两侧缓冲。
示例
Before executing the examples, set the GEOMETRY_OUTPUT_FORMAT parameter to WKT:
以下示例返回一个围绕着点且半径为 1 的多边形:
The following example uses a negative value for distance to remove small irregularities (such as spikes) from the shape.
The TO_GEOMETRY call passes in TRUE as the second argument, which allows the function to create a GEOMETRY
object for an invalid shape.