> ## 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 (Python)

> ST_VoronoiPolygons computes a two-dimensional Voronoi diagram from the vertices of the supplied geometry.

ST\_VoronoiPolygons computes 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.

SQL reference: [`ST_VoronoiPolygons`](/reference/wherobots-db/geometry-data/processing/ST_VoronoiPolygons)

## Signature

```python theme={"system"}
from sedona.spark.sql.st_functions import ST_VoronoiPolygons

ST_VoronoiPolygons(
    geometry: ColumnOrName,
    tolerance: Optional[Union[ColumnOrName, float]] = 0.0,
    extendTo: Optional[ColumnOrName] = None,
) -> Column
```

## Parameters

<ParamField path="geometry" type="ColumnOrName" required>
  Geometry column whose coordinates are to be built from.
</ParamField>

<ParamField path="tolerance" type="Optional[Union[ColumnOrName, float]]" default="0.0">
  The distance within which vertices will be considered equivalent.
  Robustness of the algorithm can be improved by supplying a nonzero tolerance distance. (default = 0.0)
</ParamField>

<ParamField path="extendTo" type="Optional[ColumnOrName]" default="None">
  If a geometry is supplied as the "extend\_to" parameter, the diagram will be extended to cover the envelope of the "extend\_to" geometry, unless that envelope is smaller than the default envelope
  (default = NULL, default envelope is boundingbox of input geometry extended by about 50% in each direction).
</ParamField>

## Returns

<ResponseField name="return" type="Column">
  The two-dimensional Voronoi diagram geometry.
</ResponseField>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.