Skip to main content
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. ST_VoronoiPolygons

Signatures

ST_VoronoiPolygons(g1: Geometry, tolerance: Double, extend_to: Geometry)

Parameters

g1
Geometry
required
The g1 value.
tolerance
Double
required
The distance tolerance.
extend_to
Geometry
required
The extend_to value.

Return type

The resulting geometry.

Example

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)))