ST_DelaunayTriangles

更新时间:
复制 MD 格式

Returns the Delaunay triangulation computed around the vertices of the input geometry object.

Syntax

geometry ST_DelaunayTriangles(geometry g1, float tolerance, int4 flags);

Parameters

ParameterDescription
g1The input geometry object.
toleranceThe snapping tolerance applied to the vertices of the input geometry object.
flagsControls the output geometry type. Valid values: 0 (default), 1, 2.

flags values

ValueOutput
0A collection of polygon objects. This is the default value.
1A MultiLineString object.
2A triangulated irregular network (TIN) surface.

Description

ST_DelaunayTriangles supports triangles and triangulated irregular network (TIN) surfaces as output geometry types.

Examples

The following example runs ST_DelaunayTriangles with default parameter settings, using a set of random points generated within a unit square polygon.

select g,ST_DelaunayTriangles(g) from (select ST_GeneratePoints('POLYGON((0 0,1 0,1 1,0 1,0 0))'::geometry,30) as g) as t;
1