> ## 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_VoronoiPolygons

Returns a two-dimensional Voronoi diagram from the vertices of the supplied geometry. The result is a GeometryCollection of Polygons that covers an envelope larger than the extent of the input vertices. Returns null if input geometry is null. Returns an empty geometry collection if the input geometry contains only one vertex. Returns an empty geometry collection if the extend\_to envelope has zero area.

<img src="https://mintcdn.com/wherobots/wLm_IRUSNlHZTHJP/images/sql-functions/ST_VoronoiPolygons/ST_VoronoiPolygons.svg?fit=max&auto=format&n=wLm_IRUSNlHZTHJP&q=85&s=7cbeadfed1000a3e23e57c328546de6a" alt="ST_VoronoiPolygons" width="500" height="300" data-path="images/sql-functions/ST_VoronoiPolygons/ST_VoronoiPolygons.svg" />

## Signatures

```sql theme={"system"}
ST_VoronoiPolygons(g1: Geometry, tolerance: Double, extend_to: Geometry)
```

## Parameters

<ParamField body="g1" type="Geometry" required>
  The g1 value.
</ParamField>

<ParamField body="tolerance" type="Double" required>
  The distance tolerance.
</ParamField>

<ParamField body="extend_to" type="Geometry" required>
  The extend\_to value.
</ParamField>

## Return type

<ResponseField type="Geometry">
  The resulting geometry.
</ResponseField>

## Example

```sql theme={"system"}
SELECT st_astext(ST_VoronoiPolygons(ST_GeomFromText('MULTIPOINT ((0 0), (1 1))')));
```

```
GEOMETRYCOLLECTION(POLYGON((-1 2,2 -1,-1 -1,-1 2)),POLYGON((-1 2,2 2,2 -1,-1 2)))
```
