ST_Buffer
Determine a buffer region around a geometry.
This function supports only points using the spherical and WGS84 coordinate systems.
Syntax
ST_Buffer(geo, distance[, nSegs[, unit[, cSys]]]);
- geo
- The input geometry.
Type: VARCHAR(ANY)
- distance
- The buffer distance.
Type: DOUBLE
- nSegs
- The number of segments used to approximate a quarter of a circle.
Type: INT
Default: 8
- unit
- The units. Possible values include 'meter', 'kilometer', 'foot', 'mile', and 'nautical
mile'.
Type: VARCHAR(ANY)
Default: 'meter'
- cSys
- The coordinate system of the input geometry.
Type: VARCHAR(ANY)
Default: The coordinate system of the input geometry's SRID or, if the input geometry has no SRID, 'WGS84'.
Returns
A value of type VARCHAR(64000) that contains a geometry that is the buffer region around the specified input geometry.
Examples
SELECT inza..ST_AsText(inza..ST_Buffer(inza..ST_Point(0, 0, 1234), 1, 2));
ST_ASTEXT
-----------
POLYGON ((1 0, 0.707106781186548 -0.707106781186547, 1.61554255216634e-15 -1,
-0.707106781186546 -0.707106781186549, -1 -3.23108510433268e-15,
-0.70710678118655 0.707106781186545, -4.62458305157398e-15 1,
0.707106781186544 0.707106781186551, 1 0))
(1 row)
SELECT inza..ST_AsText(inza..ST_Buffer(inza..ST_Point(0, 0, 1234), 1, 2, 'foot'));
ST_ASTEXT
-----------
POLYGON ((0.3048 0, 0.21552614690566 -0.21552614690566, 4.924173699003e-16 -0.3048,
-0.215526146905659 -0.21552614690566, -0.3048 -9.848347398006e-16,
-0.215526146905661 0.215526146905659, -1.40957291411975e-15 0.3048,
0.215526146905658 0.215526146905661, 0.3048 0))
(1 row)
SELECT inza..ST_AsText(inza..ST_Buffer(inza..ST_Point(0, 0, 1234), 1, 2, 'meter', 'wgs84'));
ST_ASTEXT
-----------
POLYGON ((0 9.04366924787139e-06, 6.35204378055173e-06 6.39485337411952e-06,
8.98315284119521e-06 5.53748303899457e-22, 6.35204378055173e-06 -6.39485337411952e-06,
1.1000794896585e-21 -9.04366924787139e-06, -6.35204378055173e-06 -6.39485337411952e-06,
-8.98315284119521e-06 -1.66124491169837e-21, -6.35204378055173e-06 6.39485337411952e-06,
0 9.04366924787139e-06))
(1 row)