All Products
Search
Document Center

PolarDB:ST_DelaunayTriangles

Last Updated:Mar 28, 2026

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

Syntax

geometry ST_DelaunayTriangles(geometry g1, float tolerance = 0.0, int4 flags = 0)

Parameters

ParameterDescription
g1The input geometry object.
toleranceThe tolerance of the vertices of the input geometry object. Default: 0.0.
flagsControls the return type. Default: 0. Valid values:
ValueReturn type
0A collection of polygon objects (default)
1A MultiLineString object
2A triangulated irregular network (TIN) surface

Description

ST_DelaunayTriangles supports triangles and triangulated irregular network (TIN) surfaces.

Examples

Return a polygon collection (default)

The following example generates 30 random points inside a unit square polygon and computes the Delaunay triangulation using default settings.

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;
Result of ST_DelaunayTriangles with default parameters

Return a MultiLineString (flags=1)

Setting flags to 1 returns the triangulation edges as a MultiLineString instead of filled polygons.

select ST_DelaunayTriangles(
    ST_GeomFromText('MULTIPOINT(175 150, 20 40, 50 60, 125 100)'),
    0.0,
    1
) as dtriag;

Return a TIN surface (flags=2)

Setting flags to 2 returns a triangulated irregular network (TIN) surface.

select ST_DelaunayTriangles(
    ST_GeomFromText('MULTIPOINT(175 150, 20 40, 50 60, 125 100)'),
    0.0,
    2
) as dtriag;