ST_BUFFER()

All functions > GEOSPATIAL > ST_BUFFER()

Returns a geometry that represents all points within a given distance of the input.

Signatures

Buffer

Returns: Buffered polygon (GEOM_POLYGON)

ST_BUFFER(geo: T, distance: DOUBLE) → Polygon
sql
ParameterTypeRequiredDescription
geoTYesGeometry value
distanceDOUBLEYesBuffer distance

With:

  • T : Custom types: GEOM_POINT | GEOM_LINESTRING | GEOM_POLYGON | GEOM_MULTIPOINT | GEOM_MULTILINESTRING | GEOM_MULTIPOLYGON | GEOM_MULTIANY

Signature notes:

  • The vertex layout of the result (start vertex, ring orientation, order of parts) is engine-defined: compare two results with ST_EQUALS, not their WKT
  • GEOMETRY only: GEOGRAPHY has no spherical form here; convert with ST_TOGEOMETRY for a planar answer
  • On GEOMETRY: distance is in SRID coordinate units
  • Point + buffer produces a polygon that approximates a circle with straight segments; ST_AREA of a unit-radius buffer is therefore slightly below π (not the exact disk area)
  • LineString + buffer produces a corridor polygon
  • Negative distance on Polygon shrinks it (inset); on Point/LineString produces empty geometry
  • Returns NULL if any input is NULL

Availability

StatusBackends
Availableduckdb, postgres, snowflake, databricks, serving

Examples

FeatureQL
RETURN
    -- Area of a unit-radius buffer (polygon approximation; slightly less than π)
    f1 := ST_AREA(ST_BUFFER(ST_GEOMPOINT(0.0, 0.0), 1.0))
;
Result
f1 DECIMAL
3.121445152258052