Description
The ST_Buffer
function returns an instance of WritableGeometry having a
MultiPolygon geometry inside it which represents a buffered distance around another geometry
object.
Syntax
ST_Buffer(WritableGeometry geometry, Number offset, String linearUnit, Number resolution, [String computationType])
Parameters
Parameter |
Type |
Description |
geometry
|
WritableGeometry |
The geometry to buffer. |
offset
|
Number |
The distance from the input geometry. |
linearUnits
|
String |
The desired return unit type. For valid values, see Linear Units. |
resolution
|
Number |
Specifies how many straight-line segments are used in approximating a circle.
For example, with a resolution of 8, the buffer of a point will be an octagon.
Buffers with larger resolution values take more time and space to compute. |
computationType
|
String |
Optional. Indicates the logic to be used to interpret geometry coordinates. The
computation type is based on the coordinate system of the geometry being operated
on:
- For geographic (long/lat) coordinate systems: Valid type =
SPHERICAL (default)
- For projected coordinate systems: Valid types =
CARTESIAN ,
SPHERICAL (default)
- For engineering coordinate systems: Valid type =
CARTESIAN
(default)
- CARTESIAN
- The geometry coordinates are interpreted using cartesian logic.
- SPHERICAL
- The geometry coordinates are interpreted using spherical logic.
|
Linear Units
Valid values for unit type:
Value |
Description |
mi |
miles |
km |
kilometers |
in |
inches |
ft |
feet |
yd |
yards |
mm |
millimeters |
cm |
centimeters |
m |
meters |
survey ft |
US Survey feet |
nmi |
nautical miles |
Return Values
Return Type |
Description |
WritableGeometry |
A geometry consisting of all the points within the offset distance of the input
geometry. |
Examples
SELECT ST_Buffer(ST_GeomFromWKT(t.geometry,'epsg:4267'), 5.0, 'km', 12, 'SPHERICAL' ) FROM table t;
SELECT ST_Buffer(ST_POINT(5, 6, 'epsg:4267'), 5.0, 'km', 12, 'SPHERICAL' );