ST_Buffer()¶
Returns a planar buffer geometry at a specified distance from an input geometry.
Syntax¶
ST_Buffer(geom, distance[, segs_per_quarter])
Arguments¶
Argument |
Description |
|---|---|
|
A GEOMETRY or GEOMETRY32 value. |
|
Nonnegative FLOAT64 buffer distance. |
|
Optional INT64 segments per quarter circle. |
Return Value¶
Returns a buffer geometry in the same geometry family as the input.
Usage Notes¶
Examples¶
DROP DATABASE IF EXISTS geo_operation_demo;
CREATE DATABASE geo_operation_demo;
USE geo_operation_demo;
SELECT ST_Area(ST_Buffer(ST_GeomFromText('POINT(0 0)'), 2, 32)) BETWEEN 12.55 AND 12.57 AS buffer_ok;
DROP DATABASE geo_operation_demo;