ST_Buffer

Creates a GEOMETRY object greater than or equal to a specified distance from the boundary of a spatial object. The distance is measured in Cartesian coordinate units. ST_Buffer does not accept a distance size greater than +1e15 or less than –1e15.

Behavior Type

Immutable

Syntax

ST_Buffer( g, d )

Arguments

g

Spatial object for which you want to calculate the buffer, type GEOMETRY

d

Distance from the object in Cartesian coordinate units, type FLOAT

Returns

GEOMETRY

Supported Data Types

Data Type GEOMETRY
Point Yes
Multipoint Yes
Linestring Yes
Multilinestring Yes
Polygon Yes
Multipolygon Yes
GeometryCollection Yes

Usage Tips

Example

The following example shows how to use ST_Buffer.

Returns a GEOMETRY object:

=> SELECT ST_AsText(ST_Buffer(ST_GeomFromText('POLYGON((0 1,1 4,4 3,0 1))'),1)); 
                                  ST_AsText
------------------------------------------------------------------------------
POLYGON ((-0.188847498856 -0.159920845081, -1.12155598386 0.649012935089, 0.290814745534 4.76344136152,
 0.814758063466 5.02541302048, 4.95372324225 3.68665254814, 5.04124517538 2.45512549204, -0.188847498856 -0.159920845081))
(1 row)