> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wherobots.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ST_Buffer

Returns a `Geography` whose interior is the metric ε-buffer of the input on the sphere. The `distance` argument is always interpreted as **meters** along the spheroid — there is no `useSpheroid` flag because `Geography` is inherently spheroidal.

<img src="https://mintcdn.com/wherobots/yEl9QVsCpobSsWXg/images/sql-functions/ST_Buffer_geography/ST_Buffer_geography_point.svg?fit=max&auto=format&n=yEl9QVsCpobSsWXg&q=85&s=c10889909e48ad37e21d98a9ee8b67c8" alt="ST_Buffer of a Geography point on the sphere" width="500" height="300" data-path="images/sql-functions/ST_Buffer_geography/ST_Buffer_geography_point.svg" />

<img src="https://mintcdn.com/wherobots/yEl9QVsCpobSsWXg/images/sql-functions/ST_Buffer_geography/ST_Buffer_geography_polygon.svg?fit=max&auto=format&n=yEl9QVsCpobSsWXg&q=85&s=cdfd75deee9774b5710412dc2fd64054" alt="ST_Buffer of a Geography polygon on the sphere" width="500" height="300" data-path="images/sql-functions/ST_Buffer_geography/ST_Buffer_geography_polygon.svg" />

Internally, Sedona projects the input to the most appropriate UTM zone (selected via `ST_BestSRID`), applies a planar buffer in that zone, and projects the result back to lon/lat. This produces accurate results for inputs that fit inside a single UTM zone (\~6° wide). For larger inputs the same accuracy caveats apply as for `ST_Buffer` on `Geometry` with `useSpheroid = true`.

<Note>
  **`useSpheroid` is not accepted for Geography inputs.** The 3-argument form
  `ST_Buffer(geom, distance, useSpheroid: Boolean)` from the `Geometry` overload is
  **rejected** when the first argument is a `Geography` (Geography is inherently
  spheroidal, so the flag would be redundant or contradictory). It raises
  `IllegalArgumentException`. Drop the `useSpheroid` argument, or — for a planar
  buffer — convert to `Geometry` first via `ST_GeogToGeometry` and use the `Geometry`
  overload of `ST_Buffer`.
</Note>

The optional `parameters` string accepts the same JTS-style key/value pairs used by `ST_Buffer` for `Geometry`:

| Key                              | Default | Allowed values                                                |
| :------------------------------- | :------ | :------------------------------------------------------------ |
| `quad_segs`                      | `8`     | positive integer — segments per quadrant in curved corners    |
| `endcap`                         | `round` | `round`, `flat`, `butt`, `square`                             |
| `join`                           | `round` | `round`, `mitre` (or `miter`), `bevel`                        |
| `mitre_limit` (or `miter_limit`) | `5.0`   | positive decimal                                              |
| `side`                           | `both`  | `both`, `left`, `right` (single-sided buffer for linestrings) |

Notes:

* A negative `distanceMeters` shrinks polygons (returning a smaller polygon, possibly `EMPTY` when the radius exceeds the polygon's narrowest dimension); for points and lines a negative buffer always produces an empty result.
* The output `Geography` preserves the input's SRID. If the input has no SRID set, the result is normalized to WGS84 (EPSG:4326).

## Signatures

```sql theme={"system"}
ST_Buffer (geog: Geography, distanceMeters: Double)
```

```sql theme={"system"}
ST_Buffer (geog: Geography, distanceMeters: Double, parameters: String)
```

## Parameters

<ParamField body="geog" type="Geography" required>
  The geography to buffer.
</ParamField>

<ParamField body="distanceMeters" type="Double" required>
  The buffer radius, in meters along the spheroid. Negative values shrink polygons.
</ParamField>

<ParamField body="parameters" type="String">
  Optional JTS-style buffer style parameters (see the table above).
</ParamField>

## Return type

<ResponseField type="Geography">
  The buffered geography.
</ResponseField>

## Example

```sql theme={"system"}
-- 1 km buffer around a point
SELECT ST_AsText(ST_Buffer(ST_GeogFromWKT('POINT(0 0)', 4326), 1000));

-- 200 m buffer around a polygon, with low-fidelity corners
SELECT ST_AsText(ST_Buffer(
  ST_GeogFromWKT('POLYGON((0 0, 0.01 0, 0.01 0.01, 0 0.01, 0 0))', 4326),
  200,
  'quad_segs=4 endcap=square'
));

-- Use the buffer as a containment test
SELECT ST_Contains(
  ST_Buffer(ST_GeogFromWKT('POINT(0 0)', 4326), 1000),
  ST_GeogFromWKT('POINT(0.005 0.005)', 4326)
);
```
