Returns the Delaunay triangulation computed around the vertices of the input geometry object.
Syntax
geometry ST_DelaunayTriangles(geometry g1, float tolerance, int4 flags);Parameters
| Parameter | Description |
|---|---|
g1 | The input geometry object. |
tolerance | The snapping tolerance applied to the vertices of the input geometry object. |
flags | Controls the output geometry type. Valid values: 0 (default), 1, 2. |
flags values
| Value | Output |
|---|---|
0 | A collection of polygon objects. This is the default value. |
1 | A MultiLineString object. |
2 | A 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;
该文章对您有帮助吗?